Commit 383898f7 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/21716 (ICE in reg-stack.c's swap_rtx_condition)

	PR target/21716
	* reg-stack.c (swap_rtx_condition): Don't crash if %ax user was not
	found in the basic block and last insn in the basic block is not
	INSN_P.  Remove explicit unspec numbers that are no longer valid
	from comments.

From-SVN: r100196
parent 598b2024
2005-05-26 Jakub Jelinek <jakub@redhat.com>
PR target/21716
* reg-stack.c (swap_rtx_condition): Don't crash if %ax user was not
found in the basic block and last insn in the basic block is not
INSN_P. Remove explicit unspec numbers that are no longer valid
from comments.
2005-05-26 Paolo Bonzini <bonzini@gnu.org> 2005-05-26 Paolo Bonzini <bonzini@gnu.org>
* tree-vect-transform.c (vectorizable_operation): Try word_mode * tree-vect-transform.c (vectorizable_operation): Try word_mode
......
...@@ -1231,9 +1231,9 @@ swap_rtx_condition (rtx insn) ...@@ -1231,9 +1231,9 @@ swap_rtx_condition (rtx insn)
pat = PATTERN (insn); pat = PATTERN (insn);
} }
/* See if this is, or ends in, a fnstsw, aka unspec 9. If so, we're /* See if this is, or ends in, a fnstsw. If so, we're not doing anything
not doing anything with the cc value right now. We may be able to with the cc value right now. We may be able to search for one
search for one though. */ though. */
if (GET_CODE (pat) == SET if (GET_CODE (pat) == SET
&& GET_CODE (SET_SRC (pat)) == UNSPEC && GET_CODE (SET_SRC (pat)) == UNSPEC
...@@ -1252,9 +1252,13 @@ swap_rtx_condition (rtx insn) ...@@ -1252,9 +1252,13 @@ swap_rtx_condition (rtx insn)
return 0; return 0;
} }
/* We haven't found it. */
if (insn == BB_END (current_block))
return 0;
/* So we've found the insn using this value. If it is anything /* So we've found the insn using this value. If it is anything
other than sahf, aka unspec 10, or the value does not die other than sahf or the value does not die (meaning we'd have
(meaning we'd have to search further), then we must give up. */ to search further), then we must give up. */
pat = PATTERN (insn); pat = PATTERN (insn);
if (GET_CODE (pat) != SET if (GET_CODE (pat) != SET
|| GET_CODE (SET_SRC (pat)) != UNSPEC || GET_CODE (SET_SRC (pat)) != UNSPEC
......
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