re PR testsuite/43758 (19 new GCC HEAD@158360 regressions)

PR testsuite/43758
	* target.h (struct gcc_target): Add attribute_takes_identifier_p.
	* target_def.h (TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.
	(TARGET_INITIALIZER): Use it.
	* c-common.c (attribute_takes_identifier_p): Call it.
	* c-common.h: Update prototype.
	* config/rs6000/rs6000.c (rs6000_attribute_takes_identifier_p): New.
	(TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.

From-SVN: r159079
This commit is contained in:
Jason Merrill 2010-05-05 15:33:11 -04:00 committed by Jason Merrill
parent 58c13acc6a
commit 564a129d22
7 changed files with 45 additions and 5 deletions

View File

@ -1,3 +1,14 @@
2010-05-05 Jason Merrill <jason@redhat.com>
PR testsuite/43758
* target.h (struct gcc_target): Add attribute_takes_identifier_p.
* target_def.h (TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.
(TARGET_INITIALIZER): Use it.
* c-common.c (attribute_takes_identifier_p): Call it.
* c-common.h: Update prototype.
* config/rs6000/rs6000.c (rs6000_attribute_takes_identifier_p): New.
(TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Define.
2010-05-05 Jakub Jelinek <jakub@redhat.com>
PR debug/43950

View File

@ -5816,11 +5816,14 @@ c_init_attributes (void)
identifier as an argument, so the front end shouldn't look it up. */
bool
attribute_takes_identifier_p (tree attr_id)
attribute_takes_identifier_p (const_tree attr_id)
{
return (is_attribute_p ("mode", attr_id)
|| is_attribute_p ("format", attr_id)
|| is_attribute_p ("cleanup", attr_id));
if (is_attribute_p ("mode", attr_id)
|| is_attribute_p ("format", attr_id)
|| is_attribute_p ("cleanup", attr_id))
return true;
else
return targetm.attribute_takes_identifier_p (attr_id);
}
/* Attribute handlers common to C front ends. */

View File

@ -826,7 +826,7 @@ extern void check_function_format (tree, int, tree *);
extern void set_Wformat (int);
extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
extern bool attribute_takes_identifier_p (tree);
extern bool attribute_takes_identifier_p (const_tree);
extern int c_common_handle_option (size_t code, const char *arg, int value);
extern bool c_common_missing_argument (const char *opt, size_t code);
extern tree c_common_type_for_mode (enum machine_mode, int);

View File

@ -897,6 +897,7 @@ static bool no_global_regs_above (int, bool);
static void rs6000_assemble_visibility (tree, int);
#endif
static int rs6000_ra_ever_killed (void);
static bool rs6000_attribute_takes_identifier_p (const_tree);
static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *);
static tree rs6000_handle_altivec_attribute (tree *, tree, tree, int, bool *);
static bool rs6000_ms_bitfield_layout_p (const_tree);
@ -1279,6 +1280,8 @@ static const struct attribute_spec rs6000_attribute_table[] =
#define TARGET_ATTRIBUTE_TABLE rs6000_attribute_table
#undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES rs6000_set_default_type_attributes
#undef TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P
#define TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P rs6000_attribute_takes_identifier_p
#undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_ALIGNED_DI_OP DOUBLE_INT_ASM_OP
@ -23320,6 +23323,15 @@ rs6000_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
}
/* Returns TRUE iff the target attribute indicated by ATTR_ID takes a plain
identifier as an argument, so the front end shouldn't look it up. */
static bool
rs6000_attribute_takes_identifier_p (const_tree attr_id)
{
return is_attribute_p ("altivec", attr_id);
}
/* Handle the "altivec" attribute. The attribute may have
arguments as follows:

View File

@ -9525,6 +9525,14 @@ entities to which these attributes are applied and the arguments they
take.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P (const_tree @var{name})
If defined, this target hook is a function which returns true if the
machine-specific attribute named @var{name} expects an identifier
given as its first argument to be passed on as a plain identifier, not
subjected to name lookup. If this is not defined, the default is
false for all machine-specific attributes.
@end deftypefn
@deftypefn {Target Hook} int TARGET_COMP_TYPE_ATTRIBUTES (const_tree @var{type1}, const_tree @var{type2})
If defined, this target hook is a function which returns zero if the attributes on
@var{type1} and @var{type2} are incompatible, one if they are compatible,

View File

@ -561,6 +561,7 @@
#define TARGET_MAX_ANCHOR_OFFSET 0
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P default_use_anchors_for_symbol_p
#define TARGET_FUNCTION_OK_FOR_SIBCALL hook_bool_tree_tree_false
#define TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P hook_bool_const_tree_false
#define TARGET_COMP_TYPE_ATTRIBUTES hook_int_const_tree_const_tree_1
#ifndef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES hook_void_tree
@ -932,6 +933,7 @@
TARGET_MERGE_DECL_ATTRIBUTES, \
TARGET_MERGE_TYPE_ATTRIBUTES, \
TARGET_ATTRIBUTE_TABLE, \
TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P, \
TARGET_COMP_TYPE_ATTRIBUTES, \
TARGET_SET_DEFAULT_TYPE_ATTRIBUTES, \
TARGET_INSERT_ATTRIBUTES, \

View File

@ -549,6 +549,10 @@ struct gcc_target
Ignored if NULL. */
const struct attribute_spec *attribute_table;
/* Return true iff attribute NAME expects a plain identifier as its first
argument. */
bool (*attribute_takes_identifier_p) (const_tree name);
/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
one if they are compatible and two if they are nearly compatible
(which causes a warning to be generated). */