https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82062

--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 25 Oct 2017, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82062
> 
> --- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> > There are two things to it, stripping sign-nops from the comparison
> > operand (careful!) and stripping arbitrary nops from the result
> > to look for an argument equal to the comparison operand.
> 
> My change doesn't add any stripping, it only does:
> 
>   if (TREE_CODE (arg1) == NOP_EXPR
>       && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0))
>     return true;
> 
> on the unstripped operands, i.e. it only adds back a simplified version of the
> second test removed by Marek's change; it's independent of the first test.

Simplified but not equal - you are also stripping a possible truncation.
I think the original code only ever stripped widening conversions.

It also had some additional constraints on the stripping looking
at the other comparison operand (for some weird reason...).

I guess I'm ok with your proposed change if you restrict it to
widening conversions (and use CONVERT_EXPR_P (arg1)).

Reply via email to