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

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
A better testcase:

--cut here--
struct S1
{
  char pad1;
  unsigned char val;
  short pad2;
};

struct S1 test (struct S1 a, struct S1 b)
{
  a.val += b.val;

  return a;
}
--cut here--

compiles with -O2 to:

        movl    %edi, %eax
        movl    %esi, %ecx
        movzbl  %ch, %edx
        movzbl  %ah, %esi
        addl    %esi, %edx
        movb    %dl, %ah

with patched compiler:

        movl    %edi, %eax
        movl    %esi, %edx
        addb    %ah, %dh
        movl    %edx, %eax

Reply via email to