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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-02-02
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

The IR we get is:
  _2 = b_6(D) == 0;
  _10 = _2 ? _1 : 0;
  _4 = b_6(D) * _10;

I wonder if we could do something like:

(simplify
 (mult:c (cond:s @0 @1 integer_zerop@2) @3)
 (cond @0 (mult @1 @3) @2))

But that won't solve it.

Maybe something like:

(simplify
 (mult:c @0 (cond (eq:c @0 integer_zerop@1) @2 integer_zerop))
 @1)

But both of those seems very specific patterns. Maybe something more generic is
needed though.

Reply via email to