[PowerPC] VMX testsuite fixes

Andrew Pinski pinskia@physics.uc.edu
Fri Jan 20 00:15:00 GMT 2006


On Jan 19, 2006, at 7:08 PM, Alan Modra wrote:

> On powerpc64-linux, I see gcc.dg/vmx/1b-01.c, gcc.dg/vmx/1c-02.c, and
> gcc.dg/vmx/gcc-bug-4.c all failing with errors like
>
> 1b-01.c:8: warning: cast from pointer to integer of different size
>
> Index: gcc/testsuite/gcc.dg/vmx/1c-02.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/vmx/1c-02.c	(revision 109986)
> +++ gcc/testsuite/gcc.dg/vmx/1c-02.c	(working copy)
> @@ -27,8 +27,8 @@ union { char b; vector pixel a; } p16u;
>
>  static void test()
>  {
> -  check((int)&u8.a - (int)&u8 == 16, "u8.a");
> -  check((int)&u8.e - (int)&u8 == 32, "u8.e");
> +  check((long)&u8.a - (long)&u8 == 16, "u8.a");
> +  check((long)&u8.e - (long)&u8 == 32, "u8.e");
>    check(sizeof(u8) == 48, "sizeof(u8)");
>    check(sizeof(u8u) == 16, "sizeof(u8u)");
>  }

These seem better to use offsetof instead.
And the others seems better to usie size_t which would be a typedef
to __SIZE_TYPE.

-- Pinski



More information about the Gcc-patches mailing list