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: Geoff Keating <geoffk at geoffk dot org>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 02 Nov 2003 17:36:22 -0800
- Subject: Re: [patch] execute/va-arg-25.c: Enable only if INT_MAX == 2147483647.
- References: <20031101.193643.63132267.kazu@cs.umass.edu>
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.
--
- Geoffrey Keating <geoffk@geoffk.org>