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 de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2007 23:54:17 -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 #15 from tg at mirbsd dot de 2007-01-22 23:54 -------
Subject: Re: Integer Overflow detection code optimised away,
-fwrapv broken
pinskia at gcc dot gnu dot org dixit:
>fold-const.c changed a lot, etc.
>Actually there are two different code, one I wrote which is does
>folding of a-10 > 0 into a>10 and other code which folds a-10>a into true,
>I wrote the first one.
I found the second one in CVSweb, and it's not the cause for
this unsafe "optimisation". I even changed fold-const.c to
have some wrapper around fold() which debug_tree()s me the
input and output, and the '100' stays in (at -O1, which does
exhibit the faulty behaviour already):
[â?¦] arg 1 <integer_cst 0xa7d85b7c constant 100>> arg 1 <parm_decl 0xa7d1cec4
a>>
Now I don't know any gcc internals, but I suppose this isn't
done in fold-const.câ?¦ thanks to fprintf, my beloved debugger ;)
bye,
//mirabile
--
"Using Lynx is like wearing a really good pair of shades: cuts out
the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
-- Henry Nelson, March 1999
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30477