> I'm going to bootstrap & regtest this on x86_64-unknown-linux-gnu > (with again zero testing coverage ...). The patch fixes the > reported ICE with a cross to cris-elf, more testing is appreciated > (though I guess autotesters will pick it up). > > Does it look sane?
Yes, I think so, but... > Index: gcc/expmed.c > =================================================================== > *** gcc/expmed.c (revision 173473) > --- gcc/expmed.c (working copy) > *************** expand_shift_1 (enum tree_code code, enu > *** 2141,2151 **** > rtx new_amount, other_amount; > rtx temp1; > > new_amount = op1; > ! other_amount > ! = simplify_gen_binary (MINUS, GET_MODE (op1), > ! GEN_INT (GET_MODE_BITSIZE (mode)), > ! op1); > > shifted = force_reg (mode, shifted); > > --- 2141,2156 ---- > rtx new_amount, other_amount; > rtx temp1; > > + op1_mode = GET_MODE (op1); > new_amount = op1; > ! if (op1_mode == VOIDmode) > ! other_amount = GEN_INT (GET_MODE_BITSIZE (mode) > ! - INTVAL (op1)); > ! else > ! other_amount > ! = simplify_gen_binary (MINUS, op1_mode, > ! GEN_INT (GET_MODE_BITSIZE (mode)), > ! op1); > > shifted = force_reg (mode, shifted); ... I'd test CONST_INT_P (op1) instead of op1_mode == VOIDmode since you are accessing INTVAL in the branch. -- Eric Botcazou