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

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This patch gets us back to using `&-` rather than shifts/adds for x86_64:
```
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 6da51f2aca2..4686cacd22f 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -10209,8 +10209,9 @@ expand_expr_real_2 (sepops ops, rtx target,
machine_mode tmode,
       /* Expand X*Y as X&-Y when Y must be zero or one.  */
       if (SCALAR_INT_MODE_P (mode))
        {
-         bool bit0_p = tree_nonzero_bits (treeop0) == 1;
-         bool bit1_p = tree_nonzero_bits (treeop1) == 1;
+         bool gimple_zero_one_valued_p (tree, tree (*)(tree));
+         bool bit0_p = gimple_zero_one_valued_p (treeop0, nullptr);
+         bool bit1_p = gimple_zero_one_valued_p (treeop1, nullptr);

          /* Expand X*Y as X&Y when both X and Y must be zero or one.  */
          if (bit0_p && bit1_p)
```

Reply via email to