This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: C++ PATCH to adjust empty class parameter passing ABI
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, Christophe Lyon <christophe dot lyon at linaro dot org>, Jason Merrill <jason at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Thu, 14 Apr 2016 13:23:56 +0100
- Subject: Re: RFC: C++ PATCH to adjust empty class parameter passing ABI
- Authentication-results: sourceware.org; auth=none
- References: <20160413153217 dot GT19207 at tucnak dot redhat dot com> <570E6B9B dot 1010200 at redhat dot com> <570E99E6 dot 3040603 at redhat dot com> <20160413191830 dot GW19207 at tucnak dot redhat dot com> <570EA818 dot 9030807 at redhat dot com> <CAKdteOa-ztXv9+fE5Jd26XXeKZnwAwPgcgA7PCPH6xaS0_vNiA at mail dot gmail dot com> <570F65BD dot 6030204 at foss dot arm dot com> <CAJA7tRZ-cHhufp+-tYz8gqmKvkkKZ-MRnDBgz7auhnthw8dDEQ at mail dot gmail dot com> <20160414103616 dot GB19207 at tucnak dot redhat dot com> <CAJA7tRb33ZeuXk9G0JMa5RhjcXF8T2dSbiqf0Ap9iSOh_Tir3w at mail dot gmail dot com> <20160414112559 dot GC19207 at tucnak dot redhat dot com>
On Thu, Apr 14, 2016 at 12:25 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Apr 14, 2016 at 12:19:26PM +0100, Ramana Radhakrishnan wrote:
>> Is this a valid example for what you have in mind ?
>>
>> struct baz
>> {
>> char a[1024];
>> };
>> struct foo : baz
>> {
>> };
>>
>> int bar (struct foo b, int x)
>
> No, I meant say:
> struct A {};
> struct B { A a[1024]; };
> int bar (struct B b, int c)
> {
> return c;
> }
> int baz (int a, int b, int c, int d, int e, int f, int g, struct B h, int i)
> {
> return g + i;
> }
>
> Strangely, we warn about this with -Wabi=9 even on x86_64-linux on both
> testcases, while only on baz it actually changes code generation.
>
Seems to be treated as passing a 1 byte quantity before the change.
Note you need one more parameter on aarch64 to force struct B into the
stack.
IIRC the same problem should happen on AArch32 as well but I haven't
tried that yet.
regards
Ramana