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: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, cfe-commits <cfe-commits at lists dot llvm dot org>
- Date: Sun, 7 Feb 2016 11:40:55 -0800
- Subject: Re: RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOofYT89yzF6jxFZFG2=QVQuQpEC7DP0HV_epjeawCf_sA at mail dot gmail dot com> <87d1s8wc4w dot fsf at mid dot deneb dot enyo dot de> <CAMe9rOp_6ZpR1YSJZ7AiLpa+FPRGJoLm5fTPkiH5BgF4Tkg3RA at mail dot gmail dot com>
On Sun, Feb 7, 2016 at 11:36 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Feb 7, 2016 at 11:31 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> * H. J. Lu:
>>
>>> I am proposing to update Intel386, x86-64 and IA MCU psABIs to specify
>>> how to pass/return empty struct:
>>>
>>> 1. "collection". A collection is a structure, union or C++ class.
>>> 2. "empty collection". An empty collection is:
>>> a. A collection without member. Or
>>> b. A collection with only empty collections. Or
>>> c. An array of empty collections.
>>> 3. "empty record". An empty record is Plain Old Data (POD) for the purpose
>>> of layout and
>>> a. A collection without member. Or
>>> b. A collection with only empty collections.
>>> 4. No memory slot nor register should be used to pass or return an object of
>>> empty collection.
>>
>> âAggregateâ may be the more standard term instead of collection.
>
> Aggregate also include array, which is excluded here.
>
>> I think you mean âempty recordâ under 4.
>
> Yes. I will fix it.
This typo isn't in the proposed x86 psABIs:
https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
which has "No memory slot nor register should be used to pass or return an
object of empty record."
H.J.