aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-dom.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73db887..1a9d9e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-20 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR tree-optimization/19038
+ * tree-ssa-dom.c (cprop_operand): Don't replace loop invaeriant
+ copies with loop variant ones.
+
2005-01-22 Kazu Hirata <kazu@cs.umass.edu>
* cfganal.c, real.h, reorg.c, timevar.def, tree-ssa-ccp.c,
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 35847ec..6814798 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2819,6 +2819,14 @@ cprop_operand (tree stmt, use_operand_p op_p)
extensions. */
else if (!may_propagate_copy (op, val))
return false;
+
+ /* Do not propagate copies if the propagated value is at a deeper loop
+ depth than the propagatee. Otherwise, this may move loop variant
+ variables outside of their loops and prevent coalescing
+ opportunities. If the value was loop invariant, it will be hoisted
+ by LICM and exposed for copy propagation. */
+ if (loop_depth_of_name (val) > loop_depth_of_name (op))
+ return false;
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))