On Fri, Aug 22, 2008 at 2:47 PM, Niklaus <[EMAIL PROTECTED]> wrote: > Hi, > > > When i run with the options g++ prog.c -o prog and run the exectuable > it gives me the correct output > but when i do g++ prog.c -o prog -O2 i get the wrong output >
On the trunk with -O2 I get the same value as with -O0. With -Wstrict-overflow=2, I get some warnings though: t.c:217: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2 t.c:206: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2 t.c:251: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2 t.c: In function 'int main()': t.c:210: warning: assuming signed overflow does not occur when simplifying conditional to constant t.c:210: warning: assuming signed overflow does not occur when simplifying conditional to constant Thanks, Andrew Pinski