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]

[patch] execute/simd-4.c: Enable only when sizeof(int) == 4.


Hi,

Attached is a patch to enable execute/simd-4.c only when the size of
int is 32-bit.  The testcase assumes the size of int in

  typedef int __attribute__((vector_size(8))) v2si;

and thus fails on some variants of H8 where sizeof (int) == 2.

The patch allows the assumption only when it is safe.  I took the
definition of BITSIZEOF_INT from builtin-bitops-1.c.

Tested on h8300 port.  OK to apply?

Kazu Hirata

2003-06-19  Kazu Hirata  <kazu@cs.umass.edu>

	* gcc.c-torture/execute/simd-4.c: Enable only when the size of
	int is 32-bit.

Index: testsuite/gcc.c-torture/execute/simd-4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/simd-4.c,v
retrieving revision 1.1
diff -u -r1.1 simd-4.c
--- testsuite/gcc.c-torture/execute/simd-4.c	17 Jun 2003 00:02:06 -0000	1.1
+++ testsuite/gcc.c-torture/execute/simd-4.c	19 Jun 2003 15:11:49 -0000
@@ -1,3 +1,20 @@
+#include <limits.h>
+
+#if __INT_MAX__ > 2147483647L
+# if __INT_MAX__ >= 9223372036854775807L
+#  define BITSIZEOF_INT 64
+# else
+#  define BITSIZEOF_INT 32
+# endif
+#else
+# if __INT_MAX__ >= 2147483647L
+#  define BITSIZEOF_INT 32
+# else
+#  define BITSIZEOF_INT 16
+# endif
+#endif
+
+#if BITSIZEOF_INT == 32
 typedef int __attribute__((vector_size(8))) v2si;
 long long s64;
 
@@ -14,3 +31,10 @@
     abort ();
   return 0;
 }
+#else
+int
+main ()
+{
+  return 0;
+}
+#endif


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