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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
          Component|rtl-optimization            |middle-end
   Last reconfirmed|                            |2021-11-25

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
reduced testcase (removing the globals):
typedef unsigned __int128 B;

__attribute__((noipa))
void f(unsigned short a)
{
  B b = 5;
  int size = (sizeof(b)*8)-1;
  a /= 0xfffffffd;
  B b1 = (b << (a & size) | b >> (-(a & size) & size));
  if (b1 != 5)
    __builtin_abort ();
}
int
main (void)
{
    f(0);
}

----- CUT ---
The gimple level does not change. In GCC 11 and the trunk, we have:
  _1 = (unsigned intD.9) a_8(D);
  _2 = _1 / 4294967293;
  a_9 = (short unsigned intD.18) _2;
  _13 = a_9 & 127;
  _3 = (intD.6) _13;
  b1_10 = 5 r<< _3;
  if (b1_10 != 5)

It looks like the expansion from gimple to RTL of the rotate is different
between the two versions.

Reply via email to