summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-20 12:41:20 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-20 12:41:20 +0000
commitec396ca355d0a4366de7871b0a6806a359dc2bb5 (patch)
tree41cab53e4e3521fcb9bc4fa0a65a96ef0019bf99 /gcc/tree-ssa-dom.c
parent22d7d92fc9f2516116ea97848745fa2fa0c54d4f (diff)
downloadgcc-ec396ca355d0a4366de7871b0a6806a359dc2bb5.tar.gz
2010-07-20 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44977 * tree-ssa-dom.c (propagate_rhs_into_lhs): Do not create invalid SSA form. * gcc.dg/torture/pr44977.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162334 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 68338206a8a..4715592746c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2559,6 +2559,20 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
continue;
}
+ /* It's not ok to propagate into the definition stmt of RHS.
+ <bb 9>:
+ # prephitmp.12_36 = PHI <g_67.1_6(9)>
+ g_67.1_6 = prephitmp.12_36;
+ goto <bb 9>;
+ While this is strictly all dead code we do not want to
+ deal with this here. */
+ if (TREE_CODE (rhs) == SSA_NAME
+ && SSA_NAME_DEF_STMT (rhs) == use_stmt)
+ {
+ all = false;
+ continue;
+ }
+
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
{