From bef303a73b4b107c22dfa9643898698775e9ca07 Mon Sep 17 00:00:00 2001 From: law Date: Thu, 20 May 1999 00:41:26 +0000 Subject: [PATCH] p * jump.c (can_reverse_comparison_p): Do not abort if the comparison insn for a conditional jump can not be found. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27043 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/jump.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/jump.c b/gcc/jump.c index 9b727fa..01df0db 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -3151,8 +3151,17 @@ can_reverse_comparison_p (comparison, insn) ) { rtx prev = prev_nonnote_insn (insn); - rtx set = single_set (prev); + rtx set; + /* If the comparison itself was a loop invariant, it could have been + hoisted out of the loop. If we proceed to unroll such a loop, then + we may not be able to find the comparison when copying the loop. + + Returning zero in that case is the safe thing to do. */ + if (prev == 0) + return 0; + + set = single_set (prev); if (set == 0 || SET_DEST (set) != arg0) return 0; -- 2.7.4