[PATCH] Fix small structure passing on x86-64

Richard Guenther richard.guenther@gmail.com
Tue Nov 11 16:51:00 GMT 2008


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.



More information about the Gcc-patches mailing list