http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Andrew Pinski from comment #3)

> It is a target bug if it is passing on the stack.  Note in C++, the size of
> the struct is 1 while in C, the size is 0.

Changing the testcase a bit:

  fun(d, 2, 3, 4, 5, 6, 7, 8);

cc1plus -O2 -maccumulate-outgoing-args:

        xorl    %eax, %eax
        movl    $7, %r9d
        movl    $8, 8(%rsp)
        movb    $0, (%rsp)  <--- this shouldn't be there.
        movl    $6, %r8d
        movl    $5, %ecx
        movl    $4, %edx
        movl    $3, %esi
        movl    $2, %edi
        call    _Z3fun5dummyiz

clang -O2:

        movl    $8, (%rsp)
        movl    $3, %esi
        movl    $4, %edx
        movl    $5, %ecx
        movl    $6, %r8d
        movl    $7, %r9d
        xorl    %eax, %eax
        callq   _Z3fun5dummyiz

Reply via email to