[patch committed SH] Fix ICE for gcc.dg/builtin-unreachable-4.c
Kaz Kojima
kkojima@rr.iij4u.or.jp
Fri Aug 28 02:15:00 GMT 2009
Hi,
gcc.dg/builtin-unreachable-4.c ICEs with a segfault in sh.c:
split_branches. It seems that that test makes an unusual
rtl sequence at the end of function which is unexpected for
split_branches. The attached patch is to fix this problem.
It's tested with bootstrap and the top level "make -k check"
on sh4-unknown-linux-gnu. Applied on trunk.
Regards,
kaz
--
2009-08-27 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (split_branches): Check the result of
next_active_insn.
--- ORIG/trunk/gcc/config/sh/sh.c 2009-08-21 13:39:30.000000000 +0900
+++ trunk/gcc/config/sh/sh.c 2009-08-27 17:57:37.000000000 +0900
@@ -5841,9 +5841,10 @@ split_branches (rtx first)
next = next_active_insn (insn);
- if ((JUMP_P (next)
- || ((next = next_active_insn (next))
- && JUMP_P (next)))
+ if (next
+ && (JUMP_P (next)
+ || ((next = next_active_insn (next))
+ && JUMP_P (next)))
&& GET_CODE (PATTERN (next)) == SET
&& recog_memoized (next) == CODE_FOR_jump_compact
&& ((INSN_ADDRESSES
More information about the Gcc-patches
mailing list