OSDN Git Service

* config/rs6000/rs6000-c.c (rs6000_macro_to_expand): If macro
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 17:24:41 +0000 (17:24 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Mar 2009 17:24:41 +0000 (17:24 +0000)
following vector keyword has expansion starting with pixel or bool
keyword, expand vector to __vector and pixel or bool to __pixel or
__bool.

* gcc.target/powerpc/altivec-28.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145199 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/altivec-28.c [new file with mode: 0644]

index 012e0a3..4dda512 100644 (file)
@@ -1,5 +1,10 @@
 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
 
+       * config/rs6000/rs6000-c.c (rs6000_macro_to_expand): If macro
+       following vector keyword has expansion starting with pixel or bool
+       keyword, expand vector to __vector and pixel or bool to __pixel or
+       __bool.
+
        PR c++/39554
        * opts.c (warning_disallowed_functions, warn_disallowed_functions,
        warn_if_disallowed_function_p): Removed.
index f968b2f..3aa1714 100644 (file)
@@ -188,7 +188,19 @@ rs6000_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
                tok = cpp_peek_token (pfile, idx++);
              while (tok->type == CPP_PADDING);
              ident = altivec_categorize_keyword (tok);
-             if (ident)
+             if (ident == C_CPP_HASHNODE (__pixel_keyword))
+               {
+                 expand_this = C_CPP_HASHNODE (__vector_keyword);
+                 expand_bool_pixel = __pixel_keyword;
+                 rid_code = RID_MAX;
+               }
+             else if (ident == C_CPP_HASHNODE (__bool_keyword))
+               {
+                 expand_this = C_CPP_HASHNODE (__vector_keyword);
+                 expand_bool_pixel = __bool_keyword;
+                 rid_code = RID_MAX;
+               }
+             else if (ident)
                rid_code = (enum rid)(ident->rid_code);
            }
 
index 9a6d50a..4f7b111 100644 (file)
@@ -1,5 +1,7 @@
 2009-03-28  Jakub Jelinek  <jakub@redhat.com>
 
+       * gcc.target/powerpc/altivec-28.c: New test.
+
        PR c++/39554
        * gcc.dg/wdisallowed-functions-1.c: Removed.
        * gcc.dg/wdisallowed-functions-2.c: Removed.
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-28.c b/gcc/testsuite/gcc.target/powerpc/altivec-28.c
new file mode 100644 (file)
index 0000000..db6c25a
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+
+#define B bool
+#define P pixel
+#define I int
+#define BI bool int
+#define PI pixel int
+
+vector B int i;
+vector P int j;
+vector B I k;
+vector P I l;
+vector BI m;
+vector PI n;