This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ optimization bug version 4.2.3 and version 4.1.3
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: Niklaus <niklaus at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 22 Aug 2008 15:14:29 -0700
- Subject: Re: g++ optimization bug version 4.2.3 and version 4.1.3
- References: <85e0e3140808221447p72d72012wa8bb4e505d9dd5d@mail.gmail.com>
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