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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think we need
--- 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;

   /* If the input value can't be zero, don't special case ctz (0).  */
   range_query *q = get_range_query (cfun);
@@ -3543,7 +3543,6 @@ simplify_count_zeroes (gimple_stmt_itera
       zero_ok = true;
       zero_val = 0;
       ctz_val = 0;
-      nargs = 1;
     }

   gimple_seq seq = NULL;

Reply via email to