RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

H.J. Lu via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 8 15:03:45 PST 2016


On Mon, Feb 8, 2016 at 2:55 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Mon, Feb 8, 2016 at 2:49 PM, H.J. Lu <hjl.tools at gmail.com> wrote:
>> On Mon, Feb 8, 2016 at 2:42 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>>> Do we really need an 'empty type' special case?
>>>
>>> The x86_64 psABI already seems clear that empty types with size <= 16
>>> are not passed at all. Following the algorithm in section 3.2.3, each
>>> eightbyte is classified as NO_CLASS, and thus is not passed. So the
>>> proposed change would only affect the behavior of types larger than 16
>>> bytes that contain no data. It doesn't seem worth breaking ABI to more
>>> efficiently pass those.
>>>
>>
>> Clang isn't consistent between ia32 and x86-64.  GCC isn't compatible
>> with clang.  My proposal will make GCC and clang compatible.  It also
>> makes GCC and clang behave the same on both ia32 and x86-64.
>
> OK, but if the ABI is already saying what we want, and the only
> problem is that GCC and Clang don't conform to the ABI in some cases,
> then we just need to fix the compilers and not the ABI. Which cases do
> we think the existing ABI rule misclassifies?

I want to make it explicit in psABIs to avoid any possible
confusion and x86-64 classification rules don't apply to ia32.


-- 
H.J.


More information about the cfe-commits mailing list