diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-06 11:24:07 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-06 11:24:07 +0000 |
commit | 487c79c3bd4f5e23e737763761ce044b015995b2 (patch) | |
tree | c3718ec07ee45dfd5809b7725f9a6cc7dcfb2b88 | |
parent | 90a674ebdf23f03210ef377b9e2e5d7cde19ab18 (diff) | |
download | gcc-487c79c3bd4f5e23e737763761ce044b015995b2.tar.gz |
2013-03-06 Richard Biener <rguenther@suse.de>
PR middle-end/56294
* tree-into-ssa.c (insert_phi_nodes_for): Add dumping.
(insert_updated_phi_nodes_compare_uids): New function.
(update_ssa): Sort symbols_to_rename after UID before
traversing it to insert PHI nodes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196488 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-into-ssa.c | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bb0520f00f..3eaab4c40a5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2013-03-06 Richard Biener <rguenther@suse.de> + PR middle-end/56294 + * tree-into-ssa.c (insert_phi_nodes_for): Add dumping. + (insert_updated_phi_nodes_compare_uids): New function. + (update_ssa): Sort symbols_to_rename after UID before + traversing it to insert PHI nodes. + +2013-03-06 Richard Biener <rguenther@suse.de> + PR middle-end/50494 * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Do not adjust alignment of DECL_IN_CONSTANT_POOL decls. diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 323bbb3bfd9..65c15daca4c 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -969,6 +969,12 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p) if (update_p) mark_block_for_update (bb); + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "creating PHI node in block #%d for ", bb_index); + print_generic_expr (dump_file, var, TDF_SLIM); + fprintf (dump_file, "\n"); + } phi = NULL; if (TREE_CODE (var) == SSA_NAME) @@ -3040,6 +3046,17 @@ insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks, BITMAP_FREE (idf); } +/* Sort symbols_to_rename after their DECL_UID. */ + +static int +insert_updated_phi_nodes_compare_uids (const void *a, const void *b) +{ + const_tree syma = *(const const_tree *)a; + const_tree symb = *(const const_tree *)b; + if (DECL_UID (syma) == DECL_UID (symb)) + return 0; + return DECL_UID (syma) < DECL_UID (symb) ? -1 : 1; +} /* Given a set of newly created SSA names (NEW_SSA_NAMES) and a set of existing SSA names (OLD_SSA_NAMES), update the SSA form so that: @@ -3250,6 +3267,7 @@ update_ssa (unsigned update_flags) sbitmap_free (tmp); } + symbols_to_rename.qsort (insert_updated_phi_nodes_compare_uids); FOR_EACH_VEC_ELT (symbols_to_rename, i, sym) insert_updated_phi_nodes_for (sym, dfs, blocks_to_update, update_flags); |