diff options
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 05a8d92a86f..4bad3ddaf48 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1998,6 +1998,12 @@ cprop_operand (gimple stmt, use_operand_p op_p) if (loop_depth_of_name (val) > loop_depth_of_name (op)) return; + /* 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; + /* Dump details. */ if (dump_file && (dump_flags & TDF_DETAILS)) { |