diff options
author | Jeff Law <law@gcc.gnu.org> | 1999-05-19 18:41:26 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-05-19 18:41:26 -0600 |
commit | f8d41a69eeb83daaeff527ce512bd6ef78d7ad07 (patch) | |
tree | e9f8c90ad2fc272b8aef5ef38c952e6bc1445be6 /gcc | |
parent | b87bc8f3ad3cc2ff072868b81901dd6d32c3ce62 (diff) | |
download | gcc-f8d41a69eeb83daaeff527ce512bd6ef78d7ad07.zip gcc-f8d41a69eeb83daaeff527ce512bd6ef78d7ad07.tar.gz gcc-f8d41a69eeb83daaeff527ce512bd6ef78d7ad07.tar.bz2 |
jump.c (can_reverse_comparison_p): Do not abort if the comparison insn for a conditional jump can not be found.
p
* jump.c (can_reverse_comparison_p): Do not abort if the comparison
insn for a conditional jump can not be found.
From-SVN: r27043
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/jump.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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; |