This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix optimization regression in constant folder
> Sure they do. tree-ssa-reassoc.c does, err, re-association, which is
> only valid for wrapping overflow (or as you define it, for sizetypes).
> VRP simplifies things based on for example undefined overflow. In _most_
> of the cases the middle-end now checks via the appropriate
> TYPE_OVERFLOW_* macros, but there are probably places left that just use
> TYPE_UNSIGNED to decide on overflow behavior.
Then indeed those places perhaps also have bugs and need to check
TYPE_IS_SIZETYPE too.
> Which is why, if at all, sizetype should be specialized in the overflow
> checking macros, because then a lot more optimizations benefit from it.
> Instead they now change optimization behavior on sizetypes based on their
> sign, flag setting such as -fstrict-overflow or -fwrapv, which clearly
> does not match not exposing sizetype semantics to the user.
Yes, that's *very* wrong, in my opinion. -fstrict-overflow or -fwrapv
certainly shouldn't affect sizetypes.