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/va-arg-25.c: Enable only if INT_MAX == 2147483647.


Hi,

Attached is a patch to enable only if INT_MAX == 2147483647.

The h8300 port lets you select the size of int to be either 16 or 32
bits, so the following takes up only 8 bytes.

  const vector unsigned int v1 = {10,11,12,13};

But the following memcmp compares 16 bytes of memory.

  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
    abort ();

This results in abort().

OK to apply?

Kazu Hirata

2003-11-01  Kazu Hirata  <kazu@cs.umass.edu>

	* gcc.c-torture/execute/va-arg-25.c: Enable only if INT_MAX ==
	2147483647.

Index: va-arg-25.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/va-arg-25.c,v
retrieving revision 1.1
diff -u -r1.1 va-arg-25.c
--- va-arg-25.c	10 Oct 2003 18:12:00 -0000	1.1
+++ va-arg-25.c	1 Nov 2003 20:48:13 -0000
@@ -1,6 +1,7 @@
 /* Varargs and vectors!  */
 
 #include <stdarg.h>
+#include <limits.h>
 
 #define vector __attribute__((vector_size(16)))
 
@@ -27,8 +28,10 @@
 
 int main(void)
 {
+#if INT_MAX == 2147483647
   foo (1, (vector unsigned int){10,11,12,13}, 2,
        (vector unsigned int){20,21,22,23});
+#endif
   return 0;
 }
 


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