Ian Lance Taylor <[EMAIL PROTECTED]> writes:

> We could disable VRP's assumptions about signed overflow.  I don't
> know what else we could do to fix this case.  I don't even know how we
> could issue a useful warning.  Perhaps there is a way.

It is a knotty problem.  Thanks for thinking about it.

I'm Handwaving with a capital H here, but one possibility is
for plain -O2 to keep VRP, but disable its assumption about
signed overflow when attempting to optimize away a
comparison that comes directly from the user's code (as
opposed to a comparison coming from subscript checking and
the like).

Here's another wild idea.  Perhaps GCC could add an option
"-fundefinedv" to request for aggressive optimizations
assuming that the program will never have an signed integer
overflow.  I.e., if you want the optimization that is
causing trouble here, you would specify "-O2 -fundefinedv";
but the default would be to disable this particular
troublesome optimization.


Reply via email to