This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PowerPC] VMX testsuite fixes
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zackw at panix dot com, aldyh at redhat dot com
- Date: Fri, 20 Jan 2006 10:38:20 +1030
- Subject: [PowerPC] VMX testsuite fixes
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
The following cures the warnings. I'd apply this under the obvious
rule, but I'm worried that the gcc-bug-4.c change might avoid the bug
that this test was designed to detect. Zack or Aldy, can you comment
please?
* gcc.dg/vmx/1b-01.c: Warning fix.
* gcc.dg/vmx/1c-02.c: Likewise.
* gcc.dg/vmx/gcc-bug-4.c: Likewise.
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)");
}
Index: gcc/testsuite/gcc.dg/vmx/1b-01.c
===================================================================
--- gcc/testsuite/gcc.dg/vmx/1b-01.c (revision 109986)
+++ gcc/testsuite/gcc.dg/vmx/1b-01.c (working copy)
@@ -5,7 +5,7 @@ vector unsigned char a;
static void test()
{
check(sizeof(a) == 16, "sizeof(a)");
- check(((int)&a & 15) == 0, "alignof(a)");
- check((int)&a != 0, "&a");
+ check(((long)&a & 15) == 0, "alignof(a)");
+ check((long)&a != 0, "&a");
check(vec_all_eq(a,((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})), "value(a)");
}
Index: gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c
===================================================================
--- gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c (revision 109986)
+++ gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
#include <altivec.h>
extern vector unsigned int gn00111;
-int f() { return (int)&gn00111; }
+long f() { return (long)&gn00111; }
--
Alan Modra
IBM OzLabs - Linux Technology Centre