This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/60336] empty struct value is passed differently in C and C++
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Feb 2014 18:09:46 +0000
- Subject: [Bug target/60336] empty struct value is passed differently in C and C++
- Auto-submitted: auto-generated
- References: <bug-60336-4 at http dot gcc dot gnu dot org/bugzilla/>
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