aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-10-13 20:22:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-10-13 20:22:07 +0000
commit4fc2e37df954b77dac93c8c6c889e4e3e703b517 (patch)
tree65baa180a86b2d42af9b66e92cc76a26e4c508b9 /gcc/loop-iv.c
parent258ef00780344ea3565b3276a60343529e94acc3 (diff)
downloadgcc-4fc2e37df954b77dac93c8c6c889e4e3e703b517.zip
gcc-4fc2e37df954b77dac93c8c6c889e4e3e703b517.tar.gz
gcc-4fc2e37df954b77dac93c8c6c889e4e3e703b517.tar.bz2
re PR rtl-optimization/54871 (gfortran.dg/vector_subscript_1.f90 FAILs)
PR rtl-optimization/54871 * loop-iv.c (simplify_using_initial_values): When scanning previous basic blocks, prune the recorded conditions if the current insn was not used to make a replacement. * loop-unroll.c (decide_unroll_constant_iterations): Clean up message. (unroll_loop_constant_iterations): Clarify head comment. (decide_unroll_runtime_iterations): Clean up message. (unroll_loop_runtime_iterations): Clarify head comment. (decide_peel_simple): Clean up message. (peel_loop_simple): Clarify head comment. (decide_unroll_stupid): Clean up message. (unroll_loop_stupid): Clarify head comment. From-SVN: r192426
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index f1e19d8..4619c62 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -2004,11 +2004,30 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
}
}
else
- /* If we did not use this insn to make a replacement, any overlap
- between stores in this insn and our expression will cause the
- expression to become invalid. */
- if (for_each_rtx (expr, altered_reg_used, this_altered))
- goto out;
+ {
+ rtx *pnote, *pnote_next;
+
+ /* If we did not use this insn to make a replacement, any overlap
+ between stores in this insn and our expression will cause the
+ expression to become invalid. */
+ if (for_each_rtx (expr, altered_reg_used, this_altered))
+ goto out;
+
+ /* Likewise for the conditions. */
+ for (pnote = &cond_list; *pnote; pnote = pnote_next)
+ {
+ rtx note = *pnote;
+ rtx old_cond = XEXP (note, 0);
+
+ pnote_next = &XEXP (note, 1);
+ if (for_each_rtx (&old_cond, altered_reg_used, this_altered))
+ {
+ *pnote = *pnote_next;
+ pnote_next = pnote;
+ free_EXPR_LIST_node (note);
+ }
+ }
+ }
if (CONSTANT_P (*expr))
goto out;