aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenth@gcc.gnu.org>2011-03-30 15:43:59 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-03-30 15:43:59 +0000
commit8f984534270f7ce4c0c3403929d3b56494eed110 (patch)
tree123be862ce33afbae14b31a01f85460d40b297f0 /gcc
parent4f431835313bc7d2c13508e8ed7b465e4c5ad8c8 (diff)
downloadgcc-8f984534270f7ce4c0c3403929d3b56494eed110.zip
gcc-8f984534270f7ce4c0c3403929d3b56494eed110.tar.gz
gcc-8f984534270f7ce4c0c3403929d3b56494eed110.tar.bz2
tree-dfa.c (renumber_gimple_stmt_uids): Also number PHIs.
2011-03-30 Richard Guenther <rguenther@suse.de> * tree-dfa.c (renumber_gimple_stmt_uids): Also number PHIs. * lto-streamer-out.c (output_function): Do not use renumber_gimple_stmt_uids. * lto-streamer-in.c (input_function): Likewise. From-SVN: r171734
Diffstat (limited to 'gcc')
-rw-r--r--gcc/lto-streamer-in.c11
-rw-r--r--gcc/lto-streamer-out.c15
-rw-r--r--gcc/tree-dfa.c5
3 files changed, 28 insertions, 3 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 383bfc2..70f0b0a 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1287,7 +1287,16 @@ input_function (tree fn_decl, struct data_in *data_in,
/* Fix up the call statements that are mentioned in the callgraph
edges. */
- renumber_gimple_stmt_uids ();
+ set_gimple_stmt_max_uid (cfun, 0);
+ FOR_ALL_BB (bb)
+ {
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
+ }
+ }
stmts = (gimple *) xcalloc (gimple_stmt_max_uid (fn), sizeof (gimple));
FOR_ALL_BB (bb)
{
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 4857947..d740d03 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1981,8 +1981,19 @@ output_function (struct cgraph_node *node)
/* We will renumber the statements. The code that does this uses
the same ordering that we use for serializing them so we can use
the same code on the other end and not have to write out the
- statement numbers. */
- renumber_gimple_stmt_uids ();
+ statement numbers. We do not assign UIDs to PHIs here because
+ virtual PHIs get re-computed on-the-fly which would make numbers
+ inconsistent. */
+ set_gimple_stmt_max_uid (cfun, 0);
+ FOR_ALL_BB (bb)
+ {
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
+ }
+ }
/* Output the code for the function. */
FOR_ALL_BB_FN (bb, fn)
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 9766f00..70e3c1d 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -151,6 +151,11 @@ renumber_gimple_stmt_uids (void)
FOR_ALL_BB (bb)
{
gimple_stmt_iterator bsi;
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ gimple stmt = gsi_stmt (bsi);
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
+ }
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
gimple stmt = gsi_stmt (bsi);