This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5][testsuite] Use stdint.h when needing int of exact size
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 06 Aug 2007 12:32:23 -0700
- Subject: Re: [PATCH 5/5][testsuite] Use stdint.h when needing int of exact size
- References: <20070724160434.GB4125@sygehus.dk> <20070724172453.GG4125@sygehus.dk> <20070805114044.GT25795@sygehus.dk>
- Reply-to: janis187 at us dot ibm dot com
On Sun, 2007-08-05 at 13:40 +0200, Rask Ingemann Lambertsen wrote:
> On Tue, Jul 24, 2007 at 07:24:53PM +0200, Rask Ingemann Lambertsen wrote:
> >
> > Index: gcc.c-torture/execute/simd-4.c
> > ===================================================================
> > --- gcc.c-torture/execute/simd-4.c (revision 126653)
> > +++ gcc.c-torture/execute/simd-4.c (working copy)
> > @@ -1,17 +1,18 @@
> > -typedef int __attribute__((vector_size(8))) v2si;
> > -long long s64;
> > +#include <stdint.h>
> > +typedef int32_t __attribute__((vector_size(8))) v2si;
> > +int64_t s64;
> >
> > -static inline long long
> > +static inline int64_t
> > __ev_convert_s64 (v2si a)
> > {
> > - return (long long) a;
> > + return (int64_t) a;
> > }
> >
> > int main()
> > {
> > - union { long long ll; int i[2]; } endianness_test;
> > + union { int64_t ll; int32_t i[2]; } endianness_test;
> > endianness_test.ll = 1;
> > - int little_endian = endianness_test.i[0];
> > + int32_t little_endian = endianness_test.i[0];
> > s64 = __ev_convert_s64 ((v2si){1,0xffffffff});
> > if (s64 != (little_endian ? 0xffffffff00000001LL : 0x1ffffffffLL))
> > abort ();
>
> I don't think this part was commented on yet. Is it ok?
>
> 2007-08-05 Rask Ingemann Lambertsen <rask@sygehus.dk>
>
> * gcc.c-torture/execute/simd-4.c (__ev_convert_s64)(main): Use
> int32_t for 32-bit integer. Use int64_t for 64-bit integer.
This is OK.
Janis