From fd36071f55a6a2b2fec2cc22784c3a7347bd60f8 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 29 May 2009 07:06:35 +0000 Subject: PR target/40017 * config/rs6000/rs6000-c.c (_Bool_keyword): New variable. (altivec_categorize_keyword, init_vector_keywords, rs6000_cpu_cpp_builtins): Define _Bool as conditional macro similar to bool. * gcc.target/powerpc/altivec-types-1.c: Don't expect error for __vector _Bool. * gcc.target/powerpc/altivec-30.c: New test. * gcc.target/powerpc/altivec-31.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147970 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/rs6000/rs6000-c.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/config') diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index c7adcdb5e04..33bbd65bff7 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -91,6 +91,7 @@ static GTY(()) tree __pixel_keyword; static GTY(()) tree pixel_keyword; static GTY(()) tree __bool_keyword; static GTY(()) tree bool_keyword; +static GTY(()) tree _Bool_keyword; /* Preserved across calls. */ static tree expand_bool_pixel; @@ -111,6 +112,9 @@ altivec_categorize_keyword (const cpp_token *tok) if (ident == C_CPP_HASHNODE (bool_keyword)) return C_CPP_HASHNODE (__bool_keyword); + if (ident == C_CPP_HASHNODE (_Bool_keyword)) + return C_CPP_HASHNODE (__bool_keyword); + return ident; } @@ -141,6 +145,9 @@ init_vector_keywords (void) bool_keyword = get_identifier ("bool"); C_CPP_HASHNODE (bool_keyword)->flags |= NODE_CONDITIONAL; + + _Bool_keyword = get_identifier ("_Bool"); + C_CPP_HASHNODE (_Bool_keyword)->flags |= NODE_CONDITIONAL; } /* Called to decide whether a conditional macro should be expanded. @@ -295,6 +302,7 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) builtin_define ("vector=vector"); builtin_define ("pixel=pixel"); builtin_define ("bool=bool"); + builtin_define ("_Bool=_Bool"); init_vector_keywords (); /* Enable context-sensitive macros. */ -- cgit v1.2.1