diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-07-27 09:53:33 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-07-27 09:53:33 +0200 |
commit | 036ea39917b0ef6f07a7c3c3c06002c73fd238f5 (patch) | |
tree | a35982ffc34baaebfbff808b7c0ae77b320f7b36 /gcc/attribs.c | |
parent | 2443509ba815ae9acc5303846661c409fa63436a (diff) | |
download | gcc-036ea39917b0ef6f07a7c3c3c06002c73fd238f5.zip gcc-036ea39917b0ef6f07a7c3c3c06002c73fd238f5.tar.gz gcc-036ea39917b0ef6f07a7c3c3c06002c73fd238f5.tar.bz2 |
attribs.c (decl_attributes): Imply noinline, noclone and no_icf attributes for noipa attribute.
* attribs.c (decl_attributes): Imply noinline, noclone and no_icf
attributes for noipa attribute. For naked attribute use
lookup_attribute first before lookup_attribute_spec.
* final.c (rest_of_handle_final): Disable IPA RA for functions with
noipa attribute.
* ipa-visibility.c (non_local_p): Fix comment typos. Return true
for functions with noipa attribute.
(cgraph_externally_visible_p): Return true for functions with noipa
attribute.
* cgraph.c (cgraph_node::get_availability): Return AVAIL_INTERPOSABLE
for functions with noipa attribute.
* doc/extend.texi: Document noipa function attribute.
* tree-ssa-structalias.c (refered_from_nonlocal_fn): Set *nonlocal_p
also for functions with noipa attribute.
(ipa_pta_execute): Set nonlocal_p also for nodes with noipa attribute.
c-family/
* c-attribs.c (c_common_attribute_table): Add noipa attribute.
(handle_noipa_attribute): New function.
testsuite/
* gcc.dg/attr-noipa.c: New test.
* gcc.dg/ipa/ipa-pta-18.c: New test.
* gcc.dg/ipa/ipa-sra-11.c: New test.
From-SVN: r250607
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index 5eb19e8..05fa8ef 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -404,8 +404,8 @@ decl_attributes (tree *node, tree attributes, int flags) those targets that support it. */ if (TREE_CODE (*node) == FUNCTION_DECL && attributes - && lookup_attribute_spec (get_identifier ("naked")) - && lookup_attribute ("naked", attributes) != NULL) + && 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); @@ -414,6 +414,23 @@ decl_attributes (tree *node, tree attributes, int flags) attributes = tree_cons (get_identifier ("noclone"), NULL, attributes); } + /* A "noipa" function attribute implies "noinline", "noclone" and "no_icf" + for those targets that support it. */ + if (TREE_CODE (*node) == FUNCTION_DECL + && attributes + && lookup_attribute ("noipa", attributes) != NULL + && lookup_attribute_spec (get_identifier ("noipa"))) + { + 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); + + if (lookup_attribute ("no_icf", attributes) == NULL) + attributes = tree_cons (get_identifier ("no_icf"), NULL, attributes); + } + targetm.insert_attributes (*node, &attributes); for (a = attributes; a; a = TREE_CHAIN (a)) |