PATCH RFC: Use explicit representation of infinity in VRP

Ian Lance Taylor iant@google.com
Sun Mar 11 21:33:00 GMT 2007


"Richard Guenther" <richard.guenther@gmail.com> writes:

> I do believe that -Wstrict-overflow is a good addition, but I didn't expect
> the addition of a warning possibilty to affect the set of optimizations done.
> That sounds as backward as generating different code of -Wstrict-overflow
> is in effect.

I agree that it is backward.  The problem is that of keeping track of
when gcc relies on signed overflow.  It is possible to make the patch
more invasive in order to keep better track.

In the approach I chose, I considered two things besides keeping the
patch as simple as I could.  The first was that I could not find any
cases where an optimization actually did not occur: certainly VRP's
behaviour changed, but in my testing the changes were consistently
covered by other optimizations, and always led to only inconsequential
changes in the generated code.  The second was that I believed that
the only cases in which optimization behaviour changed were cases were
gcc was relying on undefined signed overflow anyhow, and were
therefore cases of less interest.

You have found a counterexample to the second case.  I'm going to look
into whether it is possible to handle that counterexample without
significantly changing the current structure of the code.

Ian



More information about the Gcc-patches mailing list