diff --git a/gcc/config/ft32/ft32.md b/gcc/config/ft32/ft32.md index a1680666928..4d66abe009e 100644 --- a/gcc/config/ft32/ft32.md +++ b/gcc/config/ft32/ft32.md @@ -760,6 +760,12 @@ operands[0] = index; } + /* operands[2] could be an integer that is out of range for + the comparison insn we're going to emit. If so, force + it into a register. */ + if (!ft32_rimm_operand (operands[2], SImode)) + operands[2] = force_reg (SImode, operands[2]); + { rtx test = gen_rtx_GTU (VOIDmode, operands[0], operands[2]); emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2], operands[4]));