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 06:57:48 -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> <CAOfiQq=BnUC-uXcgNTNDXuLMfE9aRgNBvQ8zuPJN0WnPkCD8rw at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602191344231 dot 20277 at wotan dot suse dot de> <CAOfiQqmYkZvq93OV14m7-f7pn5j+3o4RTOSuFuLM-s7n9MFwzg at mail dot gmail dot com> <CAMe9rOr7xd+xEOABzg60859zJk8oQC94g8SiMvXr5keh6X-TvQ 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>
On Mon, Feb 22, 2016 at 4:50 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Sat, 20 Feb 2016, Richard Smith wrote:
>
>> > An empty type is a type where it and all of its subobjects
>> > (recursively) are of class, structure, union, or array type.
>> >
>> > doesn't cover "trivially-copyable".
>>
>> That's correct. Whether a type is trivially copyable is unrelated to
>> whether it is empty.
>
> I would still feel more comfortable to include the restriction to
> trivially copyable types, not in the part of definition of empty type, of
> course, but as part of the restrictions of when a type can be passed in no
> registers. Basically to clarify the intent in the psABI if there's any
> doubt. I.e. like so:
>
> ---
> 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.
> ---
>
> (With possibly a self-sufficient definition of trivially copyable, that's
> language agnostic)
>
Do you have an example in which an empty type defined above isn't
"trivially copyable"?
--
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