This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51350] [4.7 Regression] Bogus -Wstrict-overflow warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Dec 2011 15:17:08 +0000
- Subject: [Bug c++/51350] [4.7 Regression] Bogus -Wstrict-overflow warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false
- Auto-submitted: auto-generated
- References: <bug-51350-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51350
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-05 15:17:08 UTC ---
This is a valid warning. We transform (in forwprop)
int suffix = pattern_length + 1;
...
if (suffix < pattern_length)
to
if (0)
which is true only when pattern_length + 1 does not overflow.
This happens after jump-threading over
while (i > start)
suffix_table[--i] = --suffix;
in case i is <= start, thus the "regression" is probably because of
jump-threading improvements for 4.7.