aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-12-13 13:12:33 -0700
committerJeff Law <law@gcc.gnu.org>2004-12-13 13:12:33 -0700
commitfe8728354109159d6b79af99eae6e94f2a282027 (patch)
treef1f33fd9143d420f1272633b80a8e2b2bf0908f0 /gcc
parent143b6bc3190ea8dfb60bdc611c207d0e15be1cdb (diff)
downloadgcc-fe8728354109159d6b79af99eae6e94f2a282027.zip
gcc-fe8728354109159d6b79af99eae6e94f2a282027.tar.gz
gcc-fe8728354109159d6b79af99eae6e94f2a282027.tar.bz2
tree-ssa-dom.c (thread_across_edge): Do not thread jumps if a PHI argument is set from a PHI_RESULT in the same...
* 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. Co-Authored-By: Kazu Hirata <kazu@cs.umass.edu> From-SVN: r92102
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-dom.c10
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96a1648..85e7719 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-13 Jeff Law <law@redhat.com>
+ Kazu Hirata <kazu@cs.umass.edu>
+
+ * 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.
+
2004-12-13 David Edelsohn <edelsohn@gnu.org>
* xcoffout.c (xcoffout_declare_function): Always strip storage
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 3a3bdad..81fdb0e 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);
}