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.


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>


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