Hello, This patch fixes a couple of assertions while building libgcc, when configured with --enable-checking=all.
OK for trunk ? thanks Christian
2012-09-13 Christian Bruel <christian.br...@st.com> * config/sh/predicates.md (t_reg_operand): Check REG_P for SUBREG. * config/sh/sh.c (sequence_insn_p: Check INSNP_P for SEQUENCE. Index: config/sh/predicates.md =================================================================== --- config/sh/predicates.md (revision 191222) +++ config/sh/predicates.md (working copy) @@ -998,11 +998,12 @@ return REGNO (op) == T_REG; case SUBREG: - return REGNO (SUBREG_REG (op)) == T_REG; + return REG_P (SUBREG_REG (op)) && REGNO (SUBREG_REG (op)) == T_REG; case ZERO_EXTEND: case SIGN_EXTEND: return GET_CODE (XEXP (op, 0)) == SUBREG + && REG_P (SUBREG_REG (XEXP (op, 0))) && REGNO (SUBREG_REG (XEXP (op, 0))) == T_REG; default: Index: config/sh/sh.c =================================================================== --- config/sh/sh.c (revision 191222) +++ config/sh/sh.c (working copy) @@ -9876,7 +9876,7 @@ fpscr_set_from_mem (int mode, HARD_REG_SET regs_li static bool sequence_insn_p (rtx insn) { - rtx prev, next, pat; + rtx prev, next; prev = PREV_INSN (insn); if (prev == NULL) @@ -9886,11 +9886,7 @@ sequence_insn_p (rtx insn) if (next == NULL) return false; - pat = PATTERN (next); - if (pat == NULL) - return false; - - return GET_CODE (pat) == SEQUENCE; + return INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE; } int