Merge up to 171704
authorMichael Meissner <meissner@gcc.gnu.org>
Tue, 29 Mar 2011 23:35:40 +0000 (23:35 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Tue, 29 Mar 2011 23:35:40 +0000 (23:35 +0000)
From-SVN: r171707

gcc/config/rs6000/rs6000-c.c
gcc/testsuite/gcc.dg/torture/va-arg-25.c
gcc/testsuite/gcc.target/powerpc/pr48226.c [new file with mode: 0644]

index 3f4f90b236c106568d3a348fe0ffcca0d7e6e019..c1683bc709b8b0e0312f36077a86a52f58f3ea8f 100644 (file)
@@ -182,7 +182,10 @@ rs6000_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
          expand_this = C_CPP_HASHNODE (__vector_keyword);
          expand_bool_pixel = __bool_keyword;
        }
-      else if (ident)
+      /* The boost libraries have code with Iterator::vector vector in it.  If
+        we allow the normal handling, this module will be called recursively,
+        and the vector will be skipped.; */
+      else if (ident && (ident != C_CPP_HASHNODE (__vector_keyword)))
        {
          enum rid rid_code = (enum rid)(ident->rid_code);
          if (ident->type == NT_MACRO)
index 8496460d28c293ea68ad06ac14ebf59b66e522c1..8c0da549d0846b039aea8d8453eb53e5aa476f82 100644 (file)
@@ -3,6 +3,8 @@
 /* { dg-do run } */
 /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-mabi=altivec -maltivec" { target { powerpc-*-* powerpc64-*-* } } } */
+/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */
 
 #include <stdarg.h>
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/pr48226.c b/gcc/testsuite/gcc.target/powerpc/pr48226.c
new file mode 100644 (file)
index 0000000..a436f1d
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O3 -mcpu=power7" } */
+
+/* The bug shows up if you compile with -maltivec or -mcpu=power7, due to one
+   of the vector's being eliminated due to rs6000_macro_to_expand being called
+   recursively.  */
+
+struct vector {
+  float v[4];
+};
+
+struct vector vector = { 1.0, 2.0, 3.0, 4.0 };