diff options
author | Jie Zhang <jie@codesourcery.com> | 2010-07-23 14:47:46 +0000 |
---|---|---|
committer | Jie Zhang <jiez@gcc.gnu.org> | 2010-07-23 14:47:46 +0000 |
commit | 61044492190ca68b74f5e9757584f4c3c0c0654c (patch) | |
tree | b7192056c818495d64ebed95b109b7adcbf4d7e8 /gcc/attribs.c | |
parent | 9477ccb2b1e059f639abf2483893f2b950d34fed (diff) | |
download | gcc-61044492190ca68b74f5e9757584f4c3c0c0654c.zip gcc-61044492190ca68b74f5e9757584f4c3c0c0654c.tar.gz gcc-61044492190ca68b74f5e9757584f4c3c0c0654c.tar.bz2 |
re PR target/44290 (__naked attribute is broken)
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.
From-SVN: r162466
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index 0d7c132..d8daa6f 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)) |