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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Vineet Gupta from comment #6)
> > --- a/gcc/tree-ssa-forwprop.cc      2026-10-02 22:28:59.195109574 +0200
> > +++ b/gcc/tree-ssa-forwprop.cc      2026-10-12 14:47:37.704649342 +0200
> > @@ -3530,7 +3530,7 @@ simplify_count_zeroes (gimple_stmt_itera
> >                                        ctz_val) == 2;
> >        zero_val = input_bits - 1 - zero_val;
> >      }
> > -  int nargs = 2;
> > +  int nargs = 1 + zero_ok;
> 
> My version has slightly different code but equivalent code.

That is equivalent, yes.

> +  int nargs = zero_ok ? 2 : 1;
> 
> > @@ -3543,7 +3543,6 @@ simplify_count_zeroes (gimple_stmt_itera
> >        zero_ok = true;
> >        zero_val = 0;
> >        ctz_val = 0;
> > -      nargs = 1;
> >      }
> 
> I think this needs to stay:

You're right, I thought that the ranger check isn't done if zero_ok is already
true, but it is done even in that case.

Reply via email to