This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30477] Integer Overflow detection code optimised away, -fwrapv broken
- From: "tg at mirbsd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2007 14:28:56 -0000
- Subject: [Bug c/30477] Integer Overflow detection code optimised away, -fwrapv broken
- References: <bug-30477-13924@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from tg at mirbsd dot org 2007-01-25 14:28 -------
Interestingly enough, nbd of OpenWrt has found that the bug
doesn't appear (i.e. the assert is triggered) if the function
is inlined (at -O3, with -finline-functions, or the attribute).
I've used a simpler test programme while trying to look at
it myself:
tglaser@hephaistos:~ $ cat x.i
int foo(int a) { return (((a + 100) > a) ? 0 : 1); }
int main(void) { return (foo(0x7fffffff)); }
If that one returns 0, bug, if 1, correct.
I suppose this is not a problem in fold-const.c but in some
other code "optimisation".
We'd really appreciate if someone can help with this.
--
tg at mirbsd dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |3.4.6
Known to work| |4.1.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30477