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: [PowerPC] VMX testsuite fixes



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


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