This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23821] [4.3/4.4/4.5 Regression] DOM and VRP creating harder to optimize code
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2009 15:23:33 -0000
- Subject: [Bug tree-optimization/23821] [4.3/4.4/4.5 Regression] DOM and VRP creating harder to optimize code
- References: <bug-23821-5077@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #24 from rguenth at gcc dot gnu dot org 2009-09-23 15:23 -------
A simple band-aid for DOM is IMHO ok here, sth like:
Index: tree-ssa-dom.c
===================================================================
--- tree-ssa-dom.c (revision 152059)
+++ tree-ssa-dom.c (working copy)
@@ -2031,6 +2031,12 @@ cprop_operand (gimple stmt, use_operand_
if (loop_depth_of_name (val) > loop_depth_of_name (op))
return false;
+ /* Do not propagate copies into simple IV increment statements.
+ See PR23821 for how this can disturb IV analysis. */
+ if (TREE_CODE (val) != INTEGER_CST
+ && simple_iv_increment_p (stmt))
+ return false;
+
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
the patch from comment #11 is also ok, randomly propagating one or the
other operand doesn't sound useful. I will throw both patches to
performance testing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23821