This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/30477] Integer Overflow detection code optimised away, -fwrapv broken



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]