http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60657
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This fixes this for me, based on: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABIDBHE.html If gas accepts some other value beyond those, the conditions can be tweaked of course, or it could be solved through more tight predicates and/or more correct/tight constraints (don't see how 0-32 or any power of 2 applies here, plus the ICE is that const_int_operand + no specific condition allowed combine to match garbage insn and once you match it with a wrong number, when the operand doesn't have a register possibility, there is no way to reload it). Can somebody please test this (together with the testcase, dunno if -march=armv7-a is tested often enough that the testcase could be just added to gcc.c-torture/compile/pr60657.c or if you really want to add the -march=armv7-a option explicitly). I'd also think that it would be worthwhile to look at all arm insns with const_int_operand and constraint that doesn't accept all CONST_INT values and check if it shouldn't be tightened. --- gcc/config/arm/arm.md.jj 2014-01-03 11:41:20.000000000 +0100 +++ gcc/config/arm/arm.md 2014-03-27 08:53:48.267277083 +0100 @@ -4581,7 +4581,9 @@ (define_insn "*extv_reg" (sign_extract:SI (match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "const_int_operand" "M") (match_operand:SI 3 "const_int_operand" "M")))] - "arm_arch_thumb2" + "arm_arch_thumb2 + && IN_RANGE (INTVAL (operands[3]), 0, 31) + && IN_RANGE (INTVAL (operands[2]), 1, 32 - INTVAL (operands[3]))" "sbfx%?\t%0, %1, %3, %2" [(set_attr "length" "4") (set_attr "predicable" "yes") @@ -4594,7 +4596,9 @@ (define_insn "extzv_t2" (zero_extract:SI (match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "const_int_operand" "M") (match_operand:SI 3 "const_int_operand" "M")))] - "arm_arch_thumb2" + "arm_arch_thumb2 + && IN_RANGE (INTVAL (operands[3]), 0, 31) + && IN_RANGE (INTVAL (operands[2]), 1, 32 - INTVAL (operands[3]))" "ubfx%?\t%0, %1, %3, %2" [(set_attr "length" "4") (set_attr "predicable" "yes")