aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-07 14:06:02 +0200
committerRichard Biener <rguenther@suse.de>2020-12-01 15:00:30 +0100
commit3114be1ceb750f323a13dad0a419a7622bd71fbe (patch)
treeef4d674558f10d034200f741fc3dc00459a06614 /gcc
parent1cd95acac5a521937b205ace0db3f1a042561dd8 (diff)
downloadgcc-3114be1ceb750f323a13dad0a419a7622bd71fbe.zip
gcc-3114be1ceb750f323a13dad0a419a7622bd71fbe.tar.gz
gcc-3114be1ceb750f323a13dad0a419a7622bd71fbe.tar.bz2
ipa/94947 - avoid using externally_visible_p ()
externally_visible_p wasn't the correct predicate to use (even if it worked), instead we should use DECL_EXTERNAL || TREE_PUBLIC. 2020-05-07 Richard Biener <rguenther@suse.de> PR ipa/94947 * tree-ssa-structalias.c (refered_from_nonlocal_fn): Use DECL_EXTERNAL || TREE_PUBLIC instead of externally_visible. (refered_from_nonlocal_var): Likewise. (ipa_pta_execute): Likewise. (cherry picked from commit b9250b3cb91b667cd67943e0fac94bf39ac089a8)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-ssa-structalias.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 9bb6fbb..91f20ee 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -7893,7 +7893,8 @@ refered_from_nonlocal_fn (struct cgraph_node *node, void *data)
{
bool *nonlocal_p = (bool *)data;
*nonlocal_p |= (node->used_from_other_partition
- || node->externally_visible
+ || DECL_EXTERNAL (node->decl)
+ || TREE_PUBLIC (node->decl)
|| node->force_output
|| lookup_attribute ("noipa", DECL_ATTRIBUTES (node->decl)));
return false;
@@ -7905,7 +7906,8 @@ refered_from_nonlocal_var (struct varpool_node *node, void *data)
{
bool *nonlocal_p = (bool *)data;
*nonlocal_p |= (node->used_from_other_partition
- || node->externally_visible_p ()
+ || DECL_EXTERNAL (node->decl)
+ || TREE_PUBLIC (node->decl)
|| node->force_output);
return false;
}
@@ -7954,7 +7956,8 @@ ipa_pta_execute (void)
For local functions we see all callers and thus do not need initial
constraints for parameters. */
bool nonlocal_p = (node->used_from_other_partition
- || node->externally_visible
+ || DECL_EXTERNAL (node->decl)
+ || TREE_PUBLIC (node->decl)
|| node->force_output
|| lookup_attribute ("noipa",
DECL_ATTRIBUTES (node->decl)));
@@ -7994,7 +7997,8 @@ ipa_pta_execute (void)
/* For the purpose of IPA PTA unit-local globals are not
escape points. */
- bool nonlocal_p = (var->externally_visible_p ()
+ bool nonlocal_p = (DECL_EXTERNAL (var->decl)
+ || TREE_PUBLIC (var->decl)
|| var->used_from_other_partition
|| var->force_output);
var->call_for_symbol_and_aliases (refered_from_nonlocal_var,