From 34709a5a4e17b83127ae068d968222db02002db2 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 29 Mar 2011 23:35:40 +0000 Subject: [PATCH] Merge up to 171704 From-SVN: r171707 --- gcc/config/rs6000/rs6000-c.c | 5 ++++- gcc/testsuite/gcc.dg/torture/va-arg-25.c | 2 ++ gcc/testsuite/gcc.target/powerpc/pr48226.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr48226.c diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 3f4f90b236c..c1683bc709b 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -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) diff --git a/gcc/testsuite/gcc.dg/torture/va-arg-25.c b/gcc/testsuite/gcc.dg/torture/va-arg-25.c index 8496460d28c..8c0da549d08 100644 --- a/gcc/testsuite/gcc.dg/torture/va-arg-25.c +++ b/gcc/testsuite/gcc.dg/torture/va-arg-25.c @@ -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 #include diff --git a/gcc/testsuite/gcc.target/powerpc/pr48226.c b/gcc/testsuite/gcc.target/powerpc/pr48226.c new file mode 100644 index 00000000000..a436f1da5c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr48226.c @@ -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 }; -- 2.30.2