]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: "naked" attribute implies "noipa" attribute
authorMartin Liska <mliska@suse.cz>
Thu, 12 Aug 2021 15:26:51 +0000 (17:26 +0200)
committerMartin Liska <mliska@suse.cz>
Fri, 13 Aug 2021 14:04:26 +0000 (16:04 +0200)
PR ipa/101354

gcc/ChangeLog:

* attribs.c (decl_attributes): Make naked functions "noipa"
  functions.

gcc/attribs.c

index afa485ed37d48ae6a84a401e6482fe2e5615560c..0d22c20a35e16dcb75ffbae53a9d36af92a0bf53 100644 (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.  */