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: Jason Merrill <jason at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>, cfe-commits <cfe-commits at lists dot llvm dot org>
- Date: Tue, 8 Mar 2016 07:01:54 -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> <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> <alpine dot LSU dot 2 dot 20 dot 1602231618080 dot 20277 at wotan dot suse dot de> <CAMe9rOqPD_=AaaaFFnNvpEJ5N5g6vtfQvZbAh5NC=Wv4VX0gdA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602231706530 dot 20277 at wotan dot suse dot de> <CAMe9rOodKH1HXoTyd5j+jXui9ByzHVw3O1wEGYADtRT6D+sw8g at mail dot gmail dot com> <CAOfiQq=2r7b7nkSU5rhhfur8xoDXQkrnYv9y-6BmRg8zxU8ncQ at mail dot gmail dot com> <CAMe9rOqLrC1HDfevQNBnocMO+a83ZzYD=++XExeOuXTP1Fsj=A at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1602291559180 dot 20277 at wotan dot suse dot de> <56D4C87D dot 1090307 at redhat dot com> <alpine dot LSU dot 2 dot 20 dot 1603011740370 dot 20277 at wotan dot suse dot de>
On Tue, Mar 1, 2016 at 8:43 AM, Michael Matz via cfe-commits
<cfe-commits@lists.llvm.org> wrote:
> Hi,
>
> On Mon, 29 Feb 2016, Jason Merrill wrote:
>
>> > Also this insistence that all of "trivially copyable" is already quite
>> > nicely specified in the C++ ABI is still not really relevant because
>> > C++ _is not the only language out there_. I'm not sure how often I
>> > have to repeat this until people get it.
>>
>> Other language ABIs can handle language specific calling conventions as
>> appropriate for them. The psABI can only talk about things that are in
>> its domain.
>
> Naturally. How far to follow that road, though? Remove the word "class"
> from the description of empty types again? Why is that in-domain and the
> notion of trivially copyable isn't?
>
Removing "class" is a good idea. Here is the updated change:
An empty type is a type where it and all of its subobjects (recursively)
are of structure, union, or array type. No memory slot nor register
should be used to pass or return an object of empty type.
Footnote: Array of empty type can only passed by reference in C and C++.
Languages may have exceptions like array in C/C++ and class in C++.
--
H.J.