This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] execute/va-arg-25.c: Enable only if INT_MAX ==2147483647.


Geoff Keating <geoffk@geoffk.org> writes:

> Kazu Hirata <kazu@cs.umass.edu> writes:
>
>> Hi,
>> 
>> Attached is a patch to enable only if INT_MAX == 2147483647.
>> 
>> The h8300 port lets you select the size of int to be either 16 or 32
>> bits, so the following takes up only 8 bytes.
>> 
>>   const vector unsigned int v1 = {10,11,12,13};
>> 
>> But the following memcmp compares 16 bytes of memory.
>> 
>>   if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
>>     abort ();
>> 
>> This results in abort().
>
> Why does it do that?  'v' is also a 'vector unsigned int', so if it is
> 8 bytes in size then the memcmp should compare 8 bytes.

I don't know, but I'd like to point out that va-arg-25.c fails at all
optimization levels on i386 and has done since it was introduced.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]