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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
union U { int i[16]; char c[4]; };

char foo(int i)
{
  union U u;
  u.i[0] = i;
  return u.c[1];
}

I have a prototype that for the above generates

        movl    %edi, %eax
        movsbl  %ah, %eax

instead of (through RTL DSE):

        movl    %edi, %eax
        shrw    $8, %ax

The prototype ends up simply using BIT_FIELD_REFs.

  <bb 2>:
  _3 = BIT_FIELD_REF <i_2(D), 8, 8>;
  return _3;

Reply via email to