re PR target/70296 (Incorrect handling of vector X; if X is function-like macro)

PR target/70296
	* include/cpplib.h (cpp_fun_like_macro_p): New prototype.
	* macro.c (cpp_fun_like_macro_p): New function.

	* config/rs6000/rs6000-c.c (rs6000_macro_to_expand): If IDENT is
	function-like macro, peek following token(s) if it is followed
	by CPP_OPEN_PAREN token with optional padding in between, and
	if not, don't treat it like a macro.

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

From-SVN: r234371
This commit is contained in:
Jakub Jelinek 2016-03-21 16:41:13 +01:00 committed by Jakub Jelinek
parent c600d691f3
commit 6b36694859
7 changed files with 90 additions and 1 deletions

View file

@ -3301,6 +3301,15 @@ check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro,
}
}
/* Returns true of NODE is a function-like macro. */
bool
cpp_fun_like_macro_p (cpp_hashnode *node)
{
return (node->type == NT_MACRO
&& (node->flags & (NODE_BUILTIN | NODE_MACRO_ARG)) == 0
&& node->value.macro->fun_like);
}
/* Returns the name, arguments and expansion of a macro, in a format
suitable to be read back in again, and therefore also for DWARF 2
debugging info. e.g. "PASTE(X, Y) X ## Y", or "MACNAME EXPANSION".