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: Michael Matz <matz at suse dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- 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 16:30:09 +0100 (CET)
- 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> <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> <CAMe9rOqpMGOMORELX3-E6wUOcdGGkHysSBi9GFFHdHTv1es68w at mail dot gmail dot com>
Hi,
On Tue, 23 Feb 2016, H.J. Lu wrote:
> > ---
> > 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"?
The ones we've always talked about: empty C++ types with non-trivial copy
ctors or dtors. Yes, I'm aware of the fact that the Itanium C++ ABI
doesn't invoke the underlying psABI for these types (or better, it
specifies them to be passed by reference). But first, there are other
languages that have such constructs, but don't necessarily have an
written-down ABI (OO fortran anyone? Ada?). Second, there may be other
C++ ABIs that don't contain such language (which would be an ommission,
but well, happens). And third even for our C++ needs (based on the
Itanium ABI) I feel it's simply more clear and self-sufficient to be
explicit about this restriction.
It's not that we have any sort of upper bound on the number of words we're
allowed to use in the psABI, and I also don't think anything is gained by
being as terse as possible. Succinct, sure, but not as arcane as we can
make it while still being correct.
So, question back: can you imaging any cases where the "restriction" to
trivially copyable would _not_ do the thing we want?
Ciao,
Michael.
- 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