This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ optimization bug version 4.2.3 and version 4.1.3


On Fri, Aug 22, 2008 at 2:47 PM, Niklaus <niklaus@gmail.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]