summaryrefslogtreecommitdiffstats
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-24 15:35:21 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-24 15:35:21 +0000
commit7d9f258fdcec6e984c2b942382235b98e9300b1b (patch)
tree43bacd6846c8b3eb43f0268cb4dce94a7f027c38 /gcc/cgraphbuild.c
parentcc0dc61ba53d34053c5998ba909ac6ea62d06024 (diff)
downloadppe42-gcc-7d9f258fdcec6e984c2b942382235b98e9300b1b.tar.gz
ppe42-gcc-7d9f258fdcec6e984c2b942382235b98e9300b1b.zip
2013-05-24 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/57294 * cgraph.h (ipa_record_stmt_references): Declare. * cgraphbuild.c (ipa_record_stmt_references): New function. (build_cgraph_edges): Use ipa_record_stmt_references. (rebuild_cgraph_edges): Likewise. (cgraph_rebuild_references): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Discard references associated with the old statement and build references from the newly built statements. * ipa-ref.c (ipa_remove_stmt_references): New function. * ipa-ref.h (ipa_remove_stmt_references): Declare. testsuite/ * gcc.dg/ipa/pr57294.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index a74a4c043e3..fb1515d6037 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -288,6 +288,14 @@ mark_store (gimple stmt, tree t, void *data)
return false;
}
+/* Record all references from NODE that are taken in statement STMT. */
+void
+ipa_record_stmt_references (struct cgraph_node *node, gimple stmt)
+{
+ walk_stmt_load_store_addr_ops (stmt, node, mark_load, mark_store,
+ mark_address);
+}
+
/* Create cgraph edges for function calls.
Also look for functions and variables having addresses taken. */
@@ -323,8 +331,7 @@ build_cgraph_edges (void)
gimple_call_flags (stmt),
bb->count, freq);
}
- walk_stmt_load_store_addr_ops (stmt, node, mark_load,
- mark_store, mark_address);
+ ipa_record_stmt_references (node, stmt);
if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL
&& gimple_omp_parallel_child_fn (stmt))
{
@@ -348,8 +355,7 @@ build_cgraph_edges (void)
}
}
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
- mark_load, mark_store, mark_address);
+ ipa_record_stmt_references (node, gsi_stmt (gsi));
}
/* Look for initializers of constant variables and private statics. */
@@ -437,13 +443,10 @@ rebuild_cgraph_edges (void)
gimple_call_flags (stmt),
bb->count, freq);
}
- walk_stmt_load_store_addr_ops (stmt, node, mark_load,
- mark_store, mark_address);
-
+ ipa_record_stmt_references (node, stmt);
}
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
- mark_load, mark_store, mark_address);
+ ipa_record_stmt_references (node, gsi_stmt (gsi));
}
record_eh_tables (node, cfun);
gcc_assert (!node->global.inlined_to);
@@ -468,16 +471,9 @@ cgraph_rebuild_references (void)
FOR_EACH_BB (bb)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
-
- walk_stmt_load_store_addr_ops (stmt, node, mark_load,
- mark_store, mark_address);
-
- }
+ ipa_record_stmt_references (node, gsi_stmt (gsi));
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
- mark_load, mark_store, mark_address);
+ ipa_record_stmt_references (node, gsi_stmt (gsi));
}
record_eh_tables (node, cfun);
}
OpenPOWER on IntegriCloud