aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-27 13:10:47 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-27 13:10:47 +0000
commitf3b7fe44f418e63f01458e4315c7fe09fe6a3ecf (patch)
tree35f46c8e1a573b78586d01b7fac8c5bd363c3989
parent1d81597a0ceeb16c779da8dd7464bb3830fe5403 (diff)
2016-04-27 Richard Biener <rguenther@suse.de>
PR ipa/70785 * tree-ssa-structalias.c (refered_from_nonlocal_fn): New function cummulating used_from_other_partition, externally_visible and force_output from aliases. (refered_from_nonlocal_var): Likewise. (ipa_pta_execute): Use call_for_symbol_and_aliases to cummulate node flags properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@235501 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/tree-ssa-structalias.c29
2 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61cc7fdf6df..074a62c8f5e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2016-04-27 Richard Biener <rguenther@suse.de>
+
+ PR ipa/70785
+ * tree-ssa-structalias.c (refered_from_nonlocal_fn): New
+ function cummulating used_from_other_partition, externally_visible
+ and force_output from aliases.
+ (refered_from_nonlocal_var): Likewise.
+ (ipa_pta_execute): Use call_for_symbol_and_aliases to cummulate
+ node flags properly.
+
2016-04-27 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index bad1ea12a7f..f34236fdeb0 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -7486,7 +7486,7 @@ struct pt_solution ipa_escaped_pt
= { true, false, false, false, false, false, false, false, NULL };
/* Associate node with varinfo DATA. Worker for
- cgraph_for_node_and_aliases. */
+ cgraph_for_symbol_thunks_and_aliases. */
static bool
associate_varinfo_to_alias (struct cgraph_node *node, void *data)
{
@@ -7496,6 +7496,29 @@ associate_varinfo_to_alias (struct cgraph_node *node, void *data)
return false;
}
+/* Compute whether node is refered to non-locally. Worker for
+ cgraph_for_symbol_thunks_and_aliases. */
+static bool
+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
+ || node->force_output);
+ return false;
+}
+
+/* Same for varpool nodes. */
+static bool
+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->force_output);
+ return false;
+}
+
/* Execute the driver for IPA PTA. */
static unsigned int
ipa_pta_execute (void)
@@ -7559,6 +7582,8 @@ ipa_pta_execute (void)
|| node->externally_visible
|| node->force_output
|| node_address_taken);
+ node->call_for_symbol_thunks_and_aliases (refered_from_nonlocal_fn,
+ &nonlocal_p, true);
vi = create_function_info_for (node->decl,
alias_get_name (node->decl), false,
@@ -7596,6 +7621,8 @@ ipa_pta_execute (void)
bool nonlocal_p = (var->used_from_other_partition
|| var->externally_visible
|| var->force_output);
+ var->call_for_symbol_and_aliases (refered_from_nonlocal_var,
+ &nonlocal_p, true);
if (nonlocal_p)
vi->is_ipa_escape_point = true;
}