From: Bernd Schmidt Date: Wed, 15 Mar 2017 13:36:50 +0000 (+0000) Subject: c6x.c (hwloop_optimize): Handle case where the old iteration reg is used after the... X-Git-Tag: upstream/12.2.0~40687 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c194efb233f17da1d6971121dcb2f86a671f946;p=platform%2Fupstream%2Fgcc.git 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 --- 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 + + * config/c6x/c6x.c (hwloop_optimize): Handle case where the old + iteration reg is used after the loop. + 2017-03-14 Martin Sebor 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)