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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |rtl-optimization
             Target|                            |x86_64-linux-gnu

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  if (_2 != 0)
    goto <bb 4>; [21.72%]
  else
    goto <bb 3>; [78.28%]

  <bb 3> [local count: 840525096]:

  <bb 4> [local count: 1073741824]:
  # _3 = PHI <4294967295(2), _1(3)>

In general that could be written as:
_t = -(type)(_2 != 0);
_3 = _1 | _t;

That is:
unsigned b(unsigned a, unsigned b){
    if(b){
        return -1;
    }
    return a;
}
unsigned b1(unsigned a, unsigned b){
    unsigned t = b ? -1 : 0;
    return a | t;
}

Reply via email to