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>, Matthijs van Duin <matthijsvanduin at gmail dot com>, 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>
- Date: Fri, 19 Feb 2016 07:27:14 -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>
On Fri, Feb 19, 2016 at 5:35 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Thu, 18 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. No
>> >> memory slot nor register should be used to pass or return an object
>> >> of empty type.
>> >
>> > The trivially copyable is gone again. Why is it not necessary?
>>
>> The C++ ABI doesn't defer to the C psABI for types that aren't
>> trivially-copyable. See
>> http://mentorembedded.github.io/cxx-abi/abi.html#normal-call
>
> Hmm, yes, but we don't want to define something for only C and C++, but
> language independend (so far as possible). And given only the above
> language I think this type:
>
> struct S {
> S() {something();}
> };
Does "a type where it and all of its subobjects (recursively) are of
class, structure, union, or array type." exclude the above? If not,
we need better
wording. We want to include static member functions and exclude
non-static member functions.
> would be an empty type, and that's not what we want. "Trivially copyable"
> is a reasonably common abstraction (if in doubt we could even define it in
> the ABI), and captures the idea that we need well (namely that a bit-copy
> is enough).
>
>
> Ciao,
> Michael.
--
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