Commit a68d4b47 by Richard Biener

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.
parent 67d00c43
2020-05-12 Richard Biener <rguenther@suse.de> 2020-05-12 Richard Biener <rguenther@suse.de>
Backport from mainline Backport from mainline
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.
2020-05-05 Richard Biener <rguenther@suse.de> 2020-05-05 Richard Biener <rguenther@suse.de>
PR ipa/94947 PR ipa/94947
......
...@@ -8085,7 +8085,8 @@ refered_from_nonlocal_fn (struct cgraph_node *node, void *data) ...@@ -8085,7 +8085,8 @@ refered_from_nonlocal_fn (struct cgraph_node *node, void *data)
{ {
bool *nonlocal_p = (bool *)data; bool *nonlocal_p = (bool *)data;
*nonlocal_p |= (node->used_from_other_partition *nonlocal_p |= (node->used_from_other_partition
|| node->externally_visible || DECL_EXTERNAL (node->decl)
|| TREE_PUBLIC (node->decl)
|| node->force_output || node->force_output
|| lookup_attribute ("noipa", DECL_ATTRIBUTES (node->decl))); || lookup_attribute ("noipa", DECL_ATTRIBUTES (node->decl)));
return false; return false;
...@@ -8097,7 +8098,8 @@ refered_from_nonlocal_var (struct varpool_node *node, void *data) ...@@ -8097,7 +8098,8 @@ refered_from_nonlocal_var (struct varpool_node *node, void *data)
{ {
bool *nonlocal_p = (bool *)data; bool *nonlocal_p = (bool *)data;
*nonlocal_p |= (node->used_from_other_partition *nonlocal_p |= (node->used_from_other_partition
|| node->externally_visible_p () || DECL_EXTERNAL (node->decl)
|| TREE_PUBLIC (node->decl)
|| node->force_output); || node->force_output);
return false; return false;
} }
...@@ -8146,7 +8148,8 @@ ipa_pta_execute (void) ...@@ -8146,7 +8148,8 @@ ipa_pta_execute (void)
For local functions we see all callers and thus do not need initial For local functions we see all callers and thus do not need initial
constraints for parameters. */ constraints for parameters. */
bool nonlocal_p = (node->used_from_other_partition bool nonlocal_p = (node->used_from_other_partition
|| node->externally_visible || DECL_EXTERNAL (node->decl)
|| TREE_PUBLIC (node->decl)
|| node->force_output || node->force_output
|| lookup_attribute ("noipa", || lookup_attribute ("noipa",
DECL_ATTRIBUTES (node->decl))); DECL_ATTRIBUTES (node->decl)));
...@@ -8187,7 +8190,8 @@ ipa_pta_execute (void) ...@@ -8187,7 +8190,8 @@ ipa_pta_execute (void)
/* For the purpose of IPA PTA unit-local globals are not /* For the purpose of IPA PTA unit-local globals are not
escape points. */ 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->used_from_other_partition
|| var->force_output); || var->force_output);
var->call_for_symbol_and_aliases (refered_from_nonlocal_var, var->call_for_symbol_and_aliases (refered_from_nonlocal_var,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment