summaryrefslogtreecommitdiff
path: root/gcc/attribs.c
diff options
context:
space:
mode:
authorjiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-23 14:47:46 +0000
committerjiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-23 14:47:46 +0000
commitcd28ae7a10d29bf904d6fcdc55ff5233495ebb6e (patch)
treeb7192056c818495d64ebed95b109b7adcbf4d7e8 /gcc/attribs.c
parent6c359b3cc2eef224fc0af22432d32736b62eb0ce (diff)
downloadgcc-cd28ae7a10d29bf904d6fcdc55ff5233495ebb6e.tar.gz
PR target/44290
* attribs.c (decl_attributes): Insert "noinline" and "noclone" if "naked". * tree-sra.c (ipa_sra_preliminary_function_checks): Return false if ! tree_versionable_function_p. testsuite/ PR target/44290 * gcc.dg/pr44290-1.c: New test. * gcc.dg/pr44290-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162466 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r--gcc/attribs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 0d7c13218b5..d8daa6f5ed6 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -276,6 +276,19 @@ decl_attributes (tree *node, tree attributes, int flags)
TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
}
+ /* A "naked" function attribute implies "noinline" and "noclone" for
+ those targets that support it. */
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ && lookup_attribute_spec (get_identifier ("naked"))
+ && lookup_attribute ("naked", attributes) != NULL)
+ {
+ 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);
+ }
+
targetm.insert_attributes (*node, &attributes);
for (a = attributes; a; a = TREE_CHAIN (a))