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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-11-03
                 CC|                            |pinskia at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
I think part of the problem is this match pattern:
```
/* Fold (X {&,^,|} C2) << C1 into (X << C1) {&,^,|} (C2 << C1)
   (X {&,^,|} C2) >> C1 into (X >> C1) & (C2 >> C1).  */
(for shift (lshift rshift)
 (for bit_op (bit_and bit_xor bit_ior)
  (simplify
   (shift (convert?:s (bit_op:s @0 INTEGER_CST@2)) INTEGER_CST@1)
   (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
    (with { tree mask = int_const_binop (shift, fold_convert (type, @2), @1); }
     (if (mask)
      (bit_op (shift (convert @0) @1) { mask; })))))))

```
It has `:s` but we don't know if `(y & 3)` is single use until post fre1 even
though it is written with 2 `(y & 3)`s.

Reply via email to