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: Florian Weimer <fw at deneb dot enyo dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, cfe-commits <cfe-commits at lists dot llvm dot org>
- Date: Sun, 07 Feb 2016 20:31:27 +0100
- 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>
* 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.
I think you mean âempty recordâ under 4.
Any syntactical array argument (at the C level) is should be passed as
a pointer. The language appears to change that.
For 2., static members and non-data members do not count.
Does the definition of POD vary between C++ standards? Then the
calling convention would vary as well, which is probably not what we
want.
How do existing C++ compilers implement empty array members (an
extension)? Does the type of such members affect whether a class is a
standard-layout class?
Florian