[Bug tree-optimization/100499] Different results with -fpeel-loops -ftree-loop-vectorize options

amker at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 19 07:10:57 GMT 2021


--- Comment #18 from bin cheng <amker at gcc dot gnu.org> ---
Did some experiments, there are two fallouts after explicitly returning false
for unsigned/wrapping types in MULT_EXPR/MINUS_EXPR/PLUS_EXPR.  One is the
mentioned use of multiple_of_p in number_of_iterations_ne, the other is for
alignment warning in stor-layout.c.  As pointed out, the latter case is known
not overflow/wrap.  

So I am thinking to introduce an additional parameter indicating that caller
knows "top" doesn't overfow/wrap, otherwise, try to get rid of the undocumented
assumption.  we can always improve the accuracy using ranger or other tools. 
Not sure if this is the right way to do.

As for MULT_NO_OVERFLOW/PLUS_NO_OVERFLOW, IMHO, it's not that simple?  For
example, unsigned_num(multiple of 4, and larger than 0) + 0xfffffffc is
multiple of 4, but it's overflow behavior on which we rely here.

More information about the Gcc-bugs mailing list