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++/51350] [4.7 Regression] Bogus -Wstrict-overflow warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false


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.


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