rs6000-c.c (rs6000_macro_to_expand): If macro following vector keyword has expansion starting with pixel or bool...

* 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.

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

From-SVN: r145199
This commit is contained in:
Jakub Jelinek 2009-03-28 18:24:41 +01:00 committed by Jakub Jelinek
parent 574872ff83
commit b3bf8855c0
4 changed files with 36 additions and 1 deletions

View 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.

View 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);
}

View 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.

View File

@ -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;