From 45cc060eb5dcdeb7c50b4eb28410be3d1248a2ba Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 12 May 1995 08:16:31 -0700 Subject: [PATCH] (check_dbra_loop): When reversing loop when no_use_except_counting is false, there must be only one biv. From-SVN: r9642 --- gcc/loop.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/loop.c b/gcc/loop.c index 5507e09f50a..f6fc598d8d1 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -5724,6 +5724,11 @@ check_dbra_loop (loop_end, insn_count, loop_start) all memory references have non-overlapping addresses (obviously true if only one write) allow 2 insns for the compare/jump at the end of the loop. */ + /* Also, we must avoid any instructions which use both the reversed + biv and another biv. Such instructions will fail if the loop is + reversed. We meet this condition by requiring that either + no_use_except_counting is true, or else that there is only + one biv. */ int num_nonfixed_reads = 0; /* 1 if the iteration var is used only to count iterations. */ int no_use_except_counting = 0; @@ -5788,8 +5793,9 @@ check_dbra_loop (loop_end, insn_count, loop_start) && !loop_has_volatile && reversible_mem_store && (no_use_except_counting - || (bl->giv_count + bl->biv_count + num_mem_sets - + num_movables + 2 == insn_count))) + || ((bl->giv_count + bl->biv_count + num_mem_sets + + num_movables + 2 == insn_count) + && (bl == loop_iv_list && bl->next == 0)))) { rtx tem; -- 2.30.2