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: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Cc: Christophe Lyon <christophe dot lyon at linaro dot org>, Jason Merrill <jason at redhat dot com>, Jakub Jelinek <jakub 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>
- Date: Thu, 14 Apr 2016 11:25:07 +0100
- Subject: Re: RFC: C++ PATCH to adjust empty class parameter passing ABI
- Authentication-results: sourceware.org; auth=none
- References: <570D5A44 dot 6060105 at redhat dot com> <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>
On Thu, Apr 14, 2016 at 10:41 AM, Kyrill Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
>
> On 14/04/16 09:02, Christophe Lyon wrote:
>>
>> On 13 April 2016 at 22:12, Jason Merrill <jason@redhat.com> wrote:
>>>
>>> On 04/13/2016 03:18 PM, Jakub Jelinek wrote:
>>>>
>>>> On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote:
>>>>>
>>>>> commit 761983a023b5217ef831a43f423779940c788ecf
>>>>> Author: Jason Merrill <jason@redhat.com>
>>>>> Date: Tue Apr 12 13:16:50 2016 -0400
>>>>>
>>>>> gcc/
>>>>> * cfgexpand.c (pass_expand::execute): Handle attribute
>>>>> abi_warning.
>>>>> * expr.c (expand_expr_real_1): Likewise.
>>>>> gcc/cp/
>>>>> * call.c (empty_class_msg, mark_for_abi_warning): New.
>>>>> (build_call_a): Use them.
>>>>> * decl.c (store_parm_decls): Use mark_for_abi_warning.
>>>>> * error.c (pp_format_to_string): New.
>>>>
>>>>
>>>> I think you should put a space into the attribute name instead of _
>>>> to make it clear that it is not an attribute users can use directly in
>>>> their
>>>> code through __attribute__.
>>>>
>>>> Otherwise it looks reasonable to me.
>>>
>>>
>>> Thanks, applied with that change.
>>>
>> Hi,
>>
>> I'm seeing g++.dg/abi/empty13.C failing at execution on
>> aarch64-none-linux-gnu (using qemu):
>> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>>
>> and aarch64_be-none-elf (using the Foundation Model):
>> Terminated by exception.
>>
>> But it passes on aarch64-none-elf (using the Foundation Model too)
>>
>> Am I the only one?
>
> Hi Christophe,
>
> I see the test failing on aarch64-none-linux-gnu (native)
> with no output, just:
> spawn [open ...]
> FAIL: g++.dg/abi/empty13.C -std=gnu++98 execution test
>
> And I see it passing on aarch64-none-elf.
IIRC on AArch64 we document that empty classes and structs take up a
slot as per the PCS .
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0059b/IHI0059B_cppabi64.pdf
See section 3.1
For the purposes of parameter passing in
[
AAPCS64
], a parameter whose type is an empty class shall be treated as if its
type were an aggregate with a
single
member of type unsigned byte.
regards
Ramana
>
> I haven't tried aarch64_be-none-elf yet.
>
> Kyrill
>
>
>> Christophe.
>>
>>
>>
>>> Jason
>>>
>