This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35753] apparent integer math bug
- From: "regehr at cs dot utah dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2008 19:16:14 -0000
- Subject: [Bug c/35753] apparent integer math bug
- References: <bug-35753-12544@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from regehr at cs dot utah dot edu 2008-03-29 19:16 -------
Subject: Re: apparent integer math bug
> This multiplication overflows so the resulting behavior is undefined.
Right-- but always in the past it has been (or seemed) fine to assume
two's complement overflow behavior for signed arithmetic under gcc on
two's complement platforms.
I have seen the "strict overflow" options and those seem quite
reasonable. However, changing overflow behavior for multiply seems risky!
Is it still reasonable at least to rely on two's complement behavior for
signed addition and subtraction?
Thanks,
John Regehr
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35753