This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Richard Smith <richard at metafoo dot co dot uk>, Jonathan Wakely <jwakely dot gcc at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>, cfe-commits <cfe-commits at lists dot llvm dot org>, Matthijs van Duin <matthijsvanduin at gmail dot com>
- Date: Tue, 23 Feb 2016 08:28:04 -0800
- Subject: Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOrsV-zohnj=31_DDYSxUDyRDYL0anTi_NJm5vqogF9URQ at mail dot gmail dot com> <CAALWOA8s1HR4_YQ+W02U+_vX9Hqqu7dRpqU+jo0wtLEwGye9Yg at mail dot gmail dot com> <CAMe9rOoUL8qjONwjFoqKP3a2bVX0--0Z414oYDoggs=iOEwPyg at mail dot gmail dot com> <CAALWOA_Vr=iYjER_Kz-MX0HRRrzYW7on0catWgyKe_-zqHHY5A at mail dot gmail dot com> <CAMe9rOqMBvr_2vXhVqHwB-mvS3m+R-O63VpVtmk0SfK9t3tOgw at mail dot gmail dot com> <CAALWOA8euBY5a6iEQvOnziU-ttPCFWRy_2UbAuCqGstB+fzkbw at mail dot gmail dot com> <CAMe9rOrTgYha0Kvj5Uro2hhpsaPuFmL=ztLcR1J=rP0amLn8ow at mail dot gmail dot com> <CAOfiQq=zf9Ge3aBYGcKwvzLN9uZJ7n19UL43_VGAasR7ADZVOA at mail dot gmail dot com> <CAMe9rOrGr1_Gq-1QEuScs65S48Me8JNWGLekjA8OtzjAaWQ8tA at mail dot gmail dot com> <CAOfiQqnQtJLNoa_aXtxeOiPQAJ6F7Grut14S9OyoUdvdAnUZuQ at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602221347130 dot 20277 at wotan dot suse dot de> <CAMe9rOqpMGOMORELX3-E6wUOcdGGkHysSBi9GFFHdHTv1es68w at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602231618080 dot 20277 at wotan dot suse dot de> <CAMe9rOqPD_=AaaaFFnNvpEJ5N5g6vtfQvZbAh5NC=Wv4VX0gdA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602231706530 dot 20277 at wotan dot suse dot de>
On Tue, Feb 23, 2016 at 8:15 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Tue, 23 Feb 2016, H.J. Lu wrote:
>
>> I thought
>>
>> ---
>> An empty type is a type where it and all of its subobjects (recursively)
>> are of class, structure, union, or array type.
>> ---
>>
>> excluded
>>
>> struct empty
>> {
>> empty () = default;
>> };
>
>
> Why would that be excluded? There are no subobjects, hence all of them
> are of class, structure, union or array type, hence this is an empty type.
> (And that's good, it indeed looks quite empty to me). Even if you would
> add a non-trivial copy ctor, making this thing not trivially copyable
> anymore, it would still be empty. Hence, given your proposed language in
> the psABI, without reference to any other ABI (in particular not to the
> Itanium C++ ABI), you would then need to pass it without registers. That
> can't be done, and that's exactly why I find that wording incomplete. It
> needs implicit references to other languages ABIs to work.
>
It is clear to me now. Let's go with
---
An empty type is a type where it and all of its subobjects (recursively)
are of class, structure, union, or array type. No memory slot nor
register should be used to pass or return an object of empty type that's
trivially copyable.
---
Any comments?
--
H.J.
- References:
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct