#7983 closed Bugs (worksforme)
Boost:: polygon have issues when compiled using gcc 4.7.x with -O2 optimization level.
Reported by: | Owned by: | Andrii Sydorchuk | |
---|---|---|---|
Milestone: | To Be Determined | Component: | polygon |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: | herrold@… |
Description
Difference (and Sum) of 2 polygons ( a main polygon, and a small polygon inside the main polygon) creates a void or erroneous polygon when compiled with gcc 4.7 and -O2 optimization, and the same code works fine when using -01 optimization, or when using a GCC version older than 4.7 (with any optimization level) (Tested on Mingw and Linux) ( This issue is also found in 1.49 and other boost versions I have used).
Attachments (1)
Change History (10)
by , 10 years ago
Attachment: | test_polygon_diff.cpp added |
---|
comment:1 by , 10 years ago
Owner: | changed from | to
---|
comment:2 by , 10 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Please, verify with Boost 1.53. I was trying to reproduce the issue, but got the following output (both with -O1 and -O2): polyset polygons count 1 polygon 0, corners count 12
10, 10 5, 10 5, 5 5, -5 -5, -5 -5, 5 5, 5 5, 10 -10, 10 -10, -10 10, -10 10, 10
comment:3 by , 10 years ago
Sorry for the delay. My tests are made using boost 1.53. I am thinking this issue is also on Linux, but I have a gcc 4.7 version only on Windows/mingw and I am able to test it only with gcc 4.7.2 on mingw (I have only the 4.6 version on my Linux install).
Here is my command to build the test program (using boost 1.53) g++ -Wall -O2 -I /g/boost_1_53_0 test_polygon_diff.cpp
and from gcc -v the gcc version is "gcc version 4.7.2 (GCC)"
Thanks.
the output is: polyset polygons count 0
(and works fine with O1 option)
comment:4 by , 9 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
comment:6 by , 9 years ago
I do not have g++ 4.7.3, therefore I asked for help from other developers, who made some tests (tested compil options: -O1, -O2, -O3). Here are results I received: gcc version 4.7.1 20120723 [gcc-4_7-branch revision 189773] (SUSE Linux): error gcc version 4.7.2 (Debian 4.7.2-5) 32 bit: error gcc version 4.7.3 (unknown linux distrib) 32 bit: OK gcc version 4.7.3 (unknown linux distrib) 64 bit: OK gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1): OK
I hope this is useful for you. Thanks for you work.
comment:7 by , 9 years ago
Looks like the error might be specific to the 32bit platform. I will try to install gcc 4.7.2 on my 64-bit ubuntu.
comment:8 by , 9 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
I was not able to reproduce the issue, thus marking it as not repeated. Potentially this defect has to do with the Polygon rounding modes and line intersections. If that's the case the issue will be tracked under ticket #6063.
comment:9 by , 9 years ago
Cc: | added |
---|
sample of erroeous polygon when using gcc 4.7 with -O2 optimization level