[Bug tree-optimization/78821] GCC7: Copying whole 32 bits structure field by field not optimised into copying whole 32 bits at once

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 20 10:45:00 GMT 2017


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

--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
Hm, even with the latest patch, the testcase from comment #5:

typedef __SIZE_TYPE__ size_t;

void baz (char *buf, unsigned int data)
{
  buf[0] = data;
  buf[1] = data >> 8;

  buf[2] = ~data >> 8;
  buf[3] = ~data;
}

still compiles to:

        movl    %esi, %eax
        movw    %si, (%rdi)
        notl    %esi
        notl    %eax
        movb    %sil, 3(%rdi)
        movb    %ah, 2(%rdi)
        ret


More information about the Gcc-bugs mailing list