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
+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,
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))