This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/60336] empty struct value is passed differently in C and C++


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]