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: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Uros Bizjak" <ubizjak at gmail dot com>
- Cc: "Eric Botcazou" <ebotcazou at adacore dot com>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Nov 2008 10:34:09 -0600
- Subject: Re: [PATCH] Fix small structure passing on x86-64
- References: <490B5E88.3080101@gmail.com>
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.
Richard.