This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: -Wstrict-overflow
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:
> One suggestion I have is to define more functions to get rid of
> fold_{,un}defer_overflow_warnings calls around code to compute the
> number of iterations. I think having to call different functions
> (mostly _warnv functions) is more maintainable than having to call
> fold_defer_overflow_warnings all around.
I started to do it that way, and then I decided that
fold_defer_overflow_warnings was easier to understand. The problem is
that there are too many entry points to fold. It's tedious to add a
warnv variant to each one, especially when the warnv variants would
have very few callers--in fact, really just the loop iteration code.
In general the loop iteration code is a special case. It already has
its own options, -funsafe-loop-optimizations and
-Wunsafe-loop-optimizations. I think the fold_defer_overflow_warnings
is a simple interface to let the loop code shut down the warnings
which would otherwise come from fold.
As always, I'd be interested in hearing other opinions.
Ian