This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix small structure passing on x86-64
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Richard Guenther" <richard dot guenther at gmail dot com>
- Cc: "Uros Bizjak" <ubizjak at gmail dot com>, "Eric Botcazou" <ebotcazou at adacore dot com>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Nov 2008 08:44:53 -0800
- Subject: Re: [PATCH] Fix small structure passing on x86-64
- References: <490B5E88.3080101@gmail.com> <84fc9c000811110834r7b91f42fna37680ebde0d2bdf@mail.gmail.com>
On Tue, Nov 11, 2008 at 8:34 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Oct 31, 2008 at 1:37 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> Hello!
>>
>>> the structure
>>>
>>> struct S { char c; char arr[4]; float f; };
>>>
>>> is incorrect passed on x86-64/Linux with every C compiler I tried: only
>>> the first 4 bytes and the float are passed (in registers), the 5th byte is
>>> lost.
>>> That's because the first word has partial integer class
>>> X86_64_INTEGERSI_CLASS instead of full integer class X86_64_INTEGER_CLASS.
>>>
>>> Tested on x86_64-suse-linux and compat-regtested against the system
>>> compiler, OK for mainline?
>>>
>>>
>>> 2008-10-31 Eric Botcazou <ebotcazou@adacore.com>
>>>
>>> * config/i386/i386.c (classify_argument) <ARRAY_TYPE>: Promote
>>> partial
>>> integer class to full integer class if the offset is not
>>> word-aligned.
>>>
>>>
>>> 2008-10-31 Eric Botcazou <ebotcazou@adacore.com>
>>>
>>> * gcc.c-torture/execute/20081031.c: New test.
>>>
>>
>> This is OK for mainline and all release branches after a couple of days in
>> mainline without problems.
>
> Please do not put this onto the active branches. We're not yet sure the
> patch is correct.
>
FWIW, that is what icc does. Gcc was wrong.
--
H.J.