--- Comment #4 from falk at debian dot org 2006-03-23 14:57 ---
(In reply to comment #3)
> It is the -x in f where x = 0x8000 which is undefined as it overflows.
Oh. I see. Right.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26824
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-03-23 14:49 ---
It is the -x in f where x = 0x8000 which is undefined as it overflows.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--
--- Comment #2 from falk at debian dot org 2006-03-23 14:44 ---
Wait a minute. 0x8000 is unsigned. So -0x8000 is well-defined, and
is 0x8000 (unsigned). This is then converted to signed. Since 0x8000
cannot be represented in signed, the result is implementation specific.
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-03-23 14:12 ---
-0x8000 is going to overflow and for signed integers overflow is undefined.
If you want signed integers to be defined to be wrapping use -fwrapv.
--
pinskia at gcc dot gnu dot org changed:
What