Blame SOURCES/gcc34-rh178062.patch

6693b3
2006-02-25  Alexandre Oliva  <aoliva@redhat.com>
6693b3
6693b3
	* varasm.c (copy_constant): Handle VECTOR_CST.
6693b3
6693b3
	* gcc.dg/altivec-23.c: New test.
6693b3
6693b3
--- gcc/varasm.c	2006-02-25 03:52:54.000000000 -0300
6693b3
+++ gcc/varasm.c	2006-02-25 03:54:56.000000000 -0300
6693b3
@@ -2464,6 +2464,19 @@ copy_constant (tree exp)
6693b3
 	return copy;
6693b3
       }
6693b3
 
6693b3
+    case VECTOR_CST:
6693b3
+      {
6693b3
+	tree copy = copy_node (exp);
6693b3
+	tree list = copy_list (TREE_VECTOR_CST_ELTS (exp));
6693b3
+	tree tail;
6693b3
+
6693b3
+	TREE_VECTOR_CST_ELTS (copy) = list;
6693b3
+	for (tail = list; tail; tail = TREE_CHAIN (tail))
6693b3
+	  TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail));
6693b3
+
6693b3
+	return copy;
6693b3
+      }
6693b3
+
6693b3
     default:
6693b3
       {
6693b3
 	tree t;
6693b3
--- gcc/testsuite/gcc.dg/altivec-23.c	1970-01-01 00:00:00.000000000 +0000
6693b3
+++ gcc/testsuite/gcc.dg/altivec-23.c	2006-02-25 04:10:36.000000000 -0300
6693b3
@@ -0,0 +1,25 @@
6693b3
+/* Verify that it is possible to define variables of composite types
6693b3
+   containing vector types.  We used to crash handling the
6693b3
+   initializer of automatic ones.  */
6693b3
+
6693b3
+/* { dg-do compile { target powerpc*-*-* } } */
6693b3
+/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "-maltivec" } { "" } } */
6693b3
+/* { dg-options "-maltivec -mabi=altivec" } */
6693b3
+
6693b3
+#include <altivec.h>
6693b3
+
6693b3
+typedef int bt;
6693b3
+typedef vector bt vt;
6693b3
+typedef struct { vt x; bt y[sizeof(vt) / sizeof (bt)]; } st;
6693b3
+#define INIT { 1, 2, 3, 4 }
6693b3
+
6693b3
+void f ()
6693b3
+{
6693b3
+  vt x = INIT;
6693b3
+  vt y[1] = { INIT };
6693b3
+  st s = { INIT, INIT };
6693b3
+}
6693b3
+
6693b3
+vt x = INIT;
6693b3
+vt y[1] = { INIT };
6693b3
+st s = { INIT, INIT };