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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-09-26
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. The following two should be optimized too:
int g0(int n)
{
  int n1 = n & 0x8000;
  if (n1 == 0)
    return 1;
  // n1 will be 0x8000 here.
  return (n1 >> 15) & 0x1;
}

int g1(int n)
{
  int n1 = n & 0x8000;
  if (n1 == 0)
    return 1;
  // n>>15 will be xxxxxx1 here.
  return (n >> 15) & 0x1;
}

Reply via email to