On Tue, 19 May 2020, Joseph Myers wrote:

> On Tue, 19 May 2020, Richard Biener wrote:
> 
> > This fixes an integer overflow warning that ultimatively happens because
> > of TREE_OVERFLOW propagating through transforms and the existing guard
> > against this,
> > 
> > 375           if (TREE_OVERFLOW_P (ret)
> > 376               && !TREE_OVERFLOW_P (op0)
> > 377               && !TREE_OVERFLOW_P (op1))
> > 378             overflow_warning (EXPR_LOC_OR_LOC (expr, input_location,
> > 
> > being insufficient.  Rather than trying to use sth like walk_tree to
> > exhaustively walk operands (with the possibility of introducing
> > quadraticness when folding larger expressions recursively) the
> > following amends the above with an ad-hoc test for a binary op0
> > with a possibly constant op1.
> > 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?
> 
> OK.
> 
> The test in bug 32643 looks vaguely similar, but that's an older 
> regression, do I take it this patch doesn't help with that one?

Yes, it doesn't help with that older bug.  That is, it does not
change in any way where we set TREE_OVERFLOW, it just avoids
emitting an overflow warning in the above spot when overflow
was already present on original operands and thus likely(!)
propagated to the result.

Pushed.

Richard.

Reply via email to