diff options
author | Richard Biener <rguenther@suse.de> | 2020-05-05 13:09:50 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-05-05 14:41:15 +0200 |
commit | f9b5db750bc7fbba69fee93564907f7da1bca35f (patch) | |
tree | 9cd4b4a830c3c81606f2de6d02ebdde1a0f052e2 /gcc/tree-ssa-structalias.c | |
parent | 5269b24605b17211f34dd40df2d18ba7a7f481e2 (diff) | |
download | gcc-f9b5db750bc7fbba69fee93564907f7da1bca35f.zip gcc-f9b5db750bc7fbba69fee93564907f7da1bca35f.tar.gz gcc-f9b5db750bc7fbba69fee93564907f7da1bca35f.tar.bz2 |
ipa/94947 - fix test for externally visible variables for IPA PTA
This fixes lack of an escape point of externally declared variables.
2020-05-05 Richard Biener <rguenther@suse.de>
PR ipa/94947
* tree-ssa-structalias.c (ipa_pta_execute): Use
varpool_node::externally_visible_p ().
(refered_from_nonlocal_var): Likewise.
* gcc.dg/torture/pr94947-1.c: New testcase.
* gcc.dg/torture/pr94947-2.c: Likewise.
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 416a26c..e9fcafd 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -8097,7 +8097,7 @@ 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 + || node->externally_visible_p () || node->force_output); return false; } @@ -8187,8 +8187,8 @@ ipa_pta_execute (void) /* For the purpose of IPA PTA unit-local globals are not escape points. */ - bool nonlocal_p = (var->used_from_other_partition - || var->externally_visible + bool nonlocal_p = (var->externally_visible_p () + || var->used_from_other_partition || var->force_output); var->call_for_symbol_and_aliases (refered_from_nonlocal_var, &nonlocal_p, true); |