summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-22 16:48:23 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-22 16:48:23 +0000
commit652a5bec83dabc21abe6bf9848cb24f4e02afc09 (patch)
tree0a76779a7881d888f227491e074bdc5063b828ae /gcc/tree-ssa-dom.c
parent33db115fe91a3750a83e883d475635db3a4b4d0c (diff)
downloadgcc-652a5bec83dabc21abe6bf9848cb24f4e02afc09.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 35847ec3f28..68147989e49 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))