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

--- Comment #2 from Venkataramanan <venkataramanan.kumar at amd dot com> ---
(In reply to Richard Biener from comment #1)
> That you use noinline tells that glibc memcpy has the very same issue.  Note
> that similarly having bytes/shorts in the structure and using longs or ints
> to implement inlined memcpy has the same issue.
> 
> So I don't see how to easily fix this, or rather I don't think we can fix it
> at all apart from the case where we can see both the struct copy and previous
> stores to the source (thus when you enable inlining).

Actual benchmark from where I made the small test case is compiled with in
lining enabled. 

Just to show at the calling place "test" function, all stores happen in scalar
mode (4 * 64), I used  -fno-inline. Otherwise function "Set" gets inlined.

(snip)
        movq    %rsi, (%rsp)
        movq    %rdi, %rsi
        movq    %rsp, %rdi
        movq    %rdx, 8(%rsp)
        movq    %rcx, 16(%rsp)
        movq    %r8, 24(%rsp)
        call    Set
        addq    $40, %rsp
(snip)

Reply via email to