This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31075] 2's complement arithmetic (LLONG_MIN-1) works differently with and without optimization
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2007 23:00:09 -0000
- Subject: [Bug c/31075] 2's complement arithmetic (LLONG_MIN-1) works differently with and without optimization
- References: <bug-31075-14147@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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