Created attachment 23425 [details]
Complete program needed for the bug triggering
I have different result of executing program if I compile it with -On (n=1,2,3) optimization flag relative to compilation without optimizations. It seems that -On flag forces -funsafe-math-optimizations and/or -fassociative-math and/or -freciprocal-math without possibility to disable it. It effects in g++ including MinGW.
I send you program based on the floating point arithmetic rounding properties in the attachment. The only correct result of the executing this code based on the Shewchuk's summation algorithm is 0. This is realy result of the program compiled by the command line
but if I compile it by any of the command lines
g++ -O3 shewchuk.cpp
g++ -O3 -fno-unsafe-math-optimizations -fno-associative-math -fno-reciprocal-math shewchuk.cpp
I obtain the result different than zero.
You are running into PR323, use -ffloat-store or -mpc32 or use SSE and -mfpmath=sse.
*** This bug has been marked as a duplicate of bug 323 ***