From: Richard Biener Date: Thu, 7 May 2020 12:06:02 +0000 (+0200) Subject: ipa/94947 - avoid using externally_visible_p () X-Git-Tag: upstream/12.2.0~16784 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9250b3cb91b667cd67943e0fac94bf39ac089a8;p=platform%2Fupstream%2Fgcc.git 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 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. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f59940c..938fa61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2020-05-07 Richard Biener + + 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. + 2020-05-07 Erick Ochoa * gcc/tree-ssa-struct-alias.c: Fix comments diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index b37808c..44fe52e 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -8085,7 +8085,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; @@ -8097,7 +8098,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; } @@ -8146,7 +8148,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))); @@ -8187,7 +8190,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,