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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |tree-optimization
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2023-06-02
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
  _Bool _1;

  <bb 2> :
  _1 = foo ();
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :

  <bb 4> :
  # r_2 = PHI <r_5(D)(2), 1(3)>
  return r_2;

I wonder if we should address this in PHI-OPT and transform it to

 r_2 = r_5(D) | _1;

there?  There's zero_one_valued_p we could use for both the
tested value and the value or-ed into.

We already have

/* ((x & 0x1) == 0) ? y : z <op> y -> (-(typeof(y))(x & 0x1) & z) <op> y */

and

/* ((x & 0x1) == 0) ? z <op> y : y -> (-(typeof(y))(x & 0x1) & z) <op> y */

Reply via email to