summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-13 20:12:33 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-13 20:12:33 +0000
commita7ab67e036cfb21d93f7da0305e5c846d33c3719 (patch)
treef1f33fd9143d420f1272633b80a8e2b2bf0908f0 /gcc/tree-ssa-dom.c
parentc5b4d5f379a38426739964f18b4f21b955849977 (diff)
downloadgcc-a7ab67e036cfb21d93f7da0305e5c846d33c3719.tar.gz
* tree-ssa-dom.c (thread_across_edge): Do not thread jumps if a
PHI argument is set from a PHI_RESULT in the same block and the PHI argument is not the same as the PHI result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 3a3bdada4d8..81fdb0e8652 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -550,6 +550,16 @@ thread_across_edge (struct dom_walk_data *walk_data, edge e)
{
tree src = PHI_ARG_DEF_FROM_EDGE (phi, e);
tree dst = PHI_RESULT (phi);
+
+ /* If the desired argument is not the same as this PHI's result
+ and it is set by a PHI in this block, then we can not thread
+ through this block. */
+ if (src != dst
+ && TREE_CODE (src) == SSA_NAME
+ && TREE_CODE (SSA_NAME_DEF_STMT (src)) == PHI_NODE
+ && bb_for_stmt (SSA_NAME_DEF_STMT (src)) == e->dest)
+ return;
+
record_const_or_copy (dst, src);
register_new_def (dst, &block_defs_stack);
}