diff options
author | Bernd Schmidt <bernds@redhat.com> | 2017-03-15 13:36:50 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2017-03-15 13:36:50 +0000 |
commit | 6c194efb233f17da1d6971121dcb2f86a671f946 (patch) | |
tree | 014c2d803f67b1b2e73473e9435d7d6e87930f39 | |
parent | d579c38510319ca28765e3b772bb631e84091112 (diff) | |
download | gcc-6c194efb233f17da1d6971121dcb2f86a671f946.zip gcc-6c194efb233f17da1d6971121dcb2f86a671f946.tar.gz gcc-6c194efb233f17da1d6971121dcb2f86a671f946.tar.bz2 |
c6x.c (hwloop_optimize): Handle case where the old iteration reg is used after the loop.
* config/c6x/c6x.c (hwloop_optimize): Handle case where the old
iteration reg is used after the loop.
From-SVN: r246160
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/c6x/c6x.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9f1054b..eacca23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-03-15 Bernd Schmidt <bschmidt@redhat.com> + + * config/c6x/c6x.c (hwloop_optimize): Handle case where the old + iteration reg is used after the loop. + 2017-03-14 Martin Sebor <msebor@redhat.com> PR tree-optimization/79800 diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index c54d4d1..4529fd4 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -5789,8 +5789,9 @@ hwloop_optimize (hwloop_info loop) start_sequence (); insn = emit_insn (gen_mvilc (loop->iter_reg)); + if (loop->iter_reg_used_outside) + insn = emit_move_insn (loop->iter_reg, const0_rtx); insn = emit_insn (gen_sploop (GEN_INT (sp_ii))); - seq = get_insns (); if (!single_succ_p (entry_bb) || vec_safe_length (loop->incoming) > 1) |