ipa: "naked" attribute implies "noipa" attribute

PR ipa/101354

gcc/ChangeLog:

	* attribs.c (decl_attributes): Make naked functions "noipa"
	  functions.
This commit is contained in:
Martin Liska 2021-08-12 17:26:51 +02:00
parent fa28520fad
commit 4998404915
1 changed files with 3 additions and 8 deletions

View File

@ -517,14 +517,9 @@ decl_attributes (tree *node, tree attributes, int flags,
if (TREE_CODE (*node) == FUNCTION_DECL
&& attributes
&& lookup_attribute ("naked", attributes) != NULL
&& lookup_attribute_spec (get_identifier ("naked")))
{
if (lookup_attribute ("noinline", attributes) == NULL)
attributes = tree_cons (get_identifier ("noinline"), NULL, attributes);
if (lookup_attribute ("noclone", attributes) == NULL)
attributes = tree_cons (get_identifier ("noclone"), NULL, attributes);
}
&& lookup_attribute_spec (get_identifier ("naked"))
&& lookup_attribute ("noipa", attributes) == NULL)
attributes = tree_cons (get_identifier ("noipa"), NULL, attributes);
/* A "noipa" function attribute implies "noinline", "noclone" and "no_icf"
for those targets that support it. */