[Bug c/31075] 2's complement arithmetic (LLONG_MIN-1) works differently with and without optimization

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Mar 7 23:00:00 GMT 2007



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-03-07 23:00 -------
[apinski@dhcp-10-98-10-216 ~]$ ~/gcc-mainline/bin/gcc t.c -O2 -fwrapv
[apinski@dhcp-10-98-10-216 ~]$ !./
./a.out
mini64: test 2's-complement arithmetic
minint64-1 = 9223372036854775807
minint64 - 1 == MAXINT64
[apinski@dhcp-10-98-10-216 ~]$ ~/gcc-mainline/bin/gcc t.c -O2
[apinski@dhcp-10-98-10-216 ~]$ !./
./a.out
mini64: test 2's-complement arithmetic
minint64-1 = 9223372036854775807
minint64 - 1 <> MAXINT64


[apinski@dhcp-10-98-10-216 ~]$ ~/gcc-mainline/bin/gcc -v
Using built-in specs.
Target: powerpc64-unknown-linux-gnu
Configured with: /home/apinski/src/local/gcc/configure
--prefix=/home/apinski/gcc-mainline --with-mpfr=/usr/local --with-cpu=default32
Thread model: posix
gcc version 4.3.0 20070303 (experimental)


Unless something changed in the last two days.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31075



More information about the Gcc-bugs mailing list