This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: gcc 3.3 / i386 / -O2 question
- From: Beschorner Daniel <Daniel dot Beschorner at facton dot com>
- To: "'Andrew Haley'" <aph at redhat dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Nov 2004 14:02:04 +0100
- Subject: RE: gcc 3.3 / i386 / -O2 question
Thank you!
The unused array Q seems to trigger somewhat, if I remove it O2 works fine.
Strange...
Daniel
-----Ursprüngliche Nachricht-----
Von: Andrew Haley [mailto:aph@redhat.com]
Gesendet: Dienstag, 16. November 2004 13:14
An: Beschorner Daniel
Cc: 'gcc@gcc.gnu.org'
Betreff: gcc 3.3 / i386 / -O2 question
Beschorner Daniel writes:
> Sorry, if this is the wrong list, but why differ the results in this
simple > example when compiled with -O and -O2 while GCC 2.95 is working
fine?
> -fno-strict-aliasing makes no difference, but -fno-gcse-(sm) helps.
>
> outputs are
> -O: -1343238496
> -O2: -1474736480
>
> Thanks Daniel
>
>
> int A,B,C;
> int i;
> int Q[1];
> int H(int X, int Y)
> {
> return X*Y;
> }
> int main()
> {
> A=B=C=100000;
> A+=H(B,C);
Integer overflow. All bets are off.
Andrew.