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: Richard Smith <richard at metafoo dot co dot uk>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Michael Matz <matz at suse dot de>, 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: Sat, 20 Feb 2016 22:01:24 -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> <CAMe9rOqQLZgEfMBDudAekW_DUDJbofx+bj-O753Brk4YrREa+w at mail dot gmail dot com> <CAOfiQqnyde8eJPsNi=WhmGexZawD9efzeRKX7xgCN39D39BZtg at mail dot gmail dot com> <CAMe9rOoZa7se3JGFy-LMfQETWYHKUXg_jpvcgGfxNvPw+23Byg at mail dot gmail dot com> <CAOfiQqnwP=7Kitkmjm_Vs-FqrD+ro6rOb=NjVBey3h-xJE+7ww at mail dot gmail dot com> <CAMe9rOr4rr1SRVXnkGoZD0Jf46w0TuQKiAVgHRg9nCd0PkV0hA at mail dot gmail dot com> <CAOfiQqmk-h6X1iC+jz70UCyGOAaXJ6f1nuEK64R9Zqir7B=WOA at mail dot gmail dot com> <CAMe9rOqfoW1hqF=nDKbDb3hPEmhb_3U4KMu8HKqoAmdt6_ofJA at mail dot gmail dot com> <CAOfiQq=MJXKNvWYkFsiO07J2Ovf5L-XPv9mNiV-1rY3uQEQFng at mail dot gmail dot com> <CAMe9rOpnxH2Ccz7L7G6U_GpoMT0UE+E82sRxSfjg-vQP3tTDUA at mail dot gmail dot com> <CAOfiQqmJE=9HZHyTu-n+FXzh9JiP3NBEFd_rKcUBPjNPcF=e_Q at mail dot gmail dot com> <CAMe9rOqvVg7fHzTT8g76-1NSD8F-2Qa1hRN5kV-vNPTTopxWPA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602181531140 dot 20277 at wotan dot suse dot de> <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>
On Sat, Feb 20, 2016 at 9:47 PM, Richard Smith <richard@metafoo.co.uk> wrote:
> On 20 Feb 2016 6:54 p.m., "H.J. Lu" <hjl.tools@gmail.com> wrote:
>>
>> On Sat, Feb 20, 2016 at 4:57 PM, Matthijs van Duin
>> <matthijsvanduin@gmail.com> wrote:
>> > On 20 February 2016 at 23:35, H.J. Lu <hjl.tools@gmail.com> wrote:
>> >> Can a compiler tell if a copy constructor or destructor is trivial
>> >> from the class declaration without function body?
>> >
>> > Yes, the mere presence of the declaration suffices to render it
>> > non-trivial (unless explicitly declared "= default" like I did with
>> > the default constructor, in which case there's no function body).
>>
>> How about this?
>>
>> An empty type is a type where it and all of its subobjects (recursively)
>> are of class, structure, union, or array type. An empty type may only
>> have static member functions, default constructor, default copy
>> constructor, default copy assignment operator or default destructor.
>
> No, that's the wrong rule still. Please leave the C++ rule here to the C++
> ABI rather than trying to reinvent it. Whether a type is empty is completely
> orthogonal to whether it must be passed through memory for C++ ABI /
> semantics reasons.
What is the correct wording? The last one:
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".
--
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
- 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