diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-05-04 18:36:51 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-05-04 16:36:51 +0000 |
commit | 6b715bf6d991249181ce532442fa5513e137f708 (patch) | |
tree | 9eaf587465ab186e64c5890827bfe771bf2b2f5c /gcc/cgraph.c | |
parent | deef71132774618d06d571e935d10753f92d8ad9 (diff) | |
download | gcc-6b715bf6d991249181ce532442fa5513e137f708.zip gcc-6b715bf6d991249181ce532442fa5513e137f708.tar.gz gcc-6b715bf6d991249181ce532442fa5513e137f708.tar.bz2 |
cgraph.c (cgraph_node::call_for_symbol_thunks_and_aliases): Check availability on NODE, too.
* cgraph.c (cgraph_node::call_for_symbol_thunks_and_aliases):
Check availability on NODE, too.
* cgraph.h (symtab_node::call_for_symbol_and_aliases): Likewise.
(cgraph_node::call_for_symbol_and_aliases): Likewise.
(varpool_node::call_for_symbol_and_aliase): Likewise.
* ipa-pure-const.c (add_new_function): Analyze all bodies.
(propagate_pure_const): Propagate across interposable functions, too.
(skip_function_for_local_pure_const): Do not skip interposable bodies
with aliases.
(pass_local_pure_const::execute): Update.
* gcc.dg/ipa/pure-const-3.c: New testcase.
From-SVN: r235887
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 782cb52..0c6ff93 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2289,7 +2289,7 @@ cgraph_node::can_be_local_p (void) } /* Call callback on cgraph_node, thunks and aliases associated to cgraph_node. - When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are + When INCLUDE_OVERWRITABLE is false, overwritable symbols are skipped. When EXCLUDE_VIRTUAL_THUNKS is true, virtual thunks are skipped. */ bool @@ -2301,9 +2301,14 @@ cgraph_node::call_for_symbol_thunks_and_aliases (bool (*callback) { cgraph_edge *e; ipa_ref *ref; + enum availability avail = AVAIL_AVAILABLE; - if (callback (this, data)) - return true; + if (include_overwritable + || (avail = get_availability ()) > AVAIL_INTERPOSABLE) + { + if (callback (this, data)) + return true; + } FOR_EACH_ALIAS (this, ref) { cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring); @@ -2314,7 +2319,7 @@ cgraph_node::call_for_symbol_thunks_and_aliases (bool (*callback) exclude_virtual_thunks)) return true; } - if (get_availability () <= AVAIL_INTERPOSABLE) + if (avail <= AVAIL_INTERPOSABLE) return false; for (e = callers; e; e = e->next_caller) if (e->caller->thunk.thunk_p |