This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] execute/va-arg-25.c: Enable only if INT_MAX ==2147483647.
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Kazu Hirata <kazu at cs dot umass dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 02 Nov 2003 18:41:43 -0800
- Subject: Re: [patch] execute/va-arg-25.c: Enable only if INT_MAX ==2147483647.
- References: <20031101.193643.63132267.kazu@cs.umass.edu><jm1xsqw7vt.fsf@desire.geoffk.org>
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