Commit 668d07be by Jim Wilson Committed by Jim Wilson

Fix loop reversal bug reported by Joern Rennecke.

	* loop.c (check_dbra_loop): When normalize comparison_val, add check
	to verify it is non-negative.

From-SVN: r19030
parent a59ca936
Tue Apr 7 11:58:04 1998 Jim Wilson <wilson@cygnus.com>
* loop.c (check_dbra_loop): When normalize comparison_val, add check
to verify it is non-negative.
Tue Apr 7 02:01:47 1998 Richard Henderson <rth@cygnus.com>
* alpha.c (alpha_expand_block_move): Correctly collect block offsets.
......
......@@ -6281,7 +6281,10 @@ check_dbra_loop (loop_end, insn_count, loop_start)
&& GET_CODE (initial_value) == CONST_INT)
{
comparison_val = comparison_val - INTVAL (bl->initial_value);
initial_value = const0_rtx;
/* Check for overflow. If comparison_val ends up as a
negative value, then we can't reverse the loop. */
if (comparison_val >= 0)
initial_value = const0_rtx;
}
/* If the initial value is not zero, or if the comparison
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment