When LRA puts a constant which is part of subreg, it uses wrong mode for
subreg of the pool memory. The patch fixes this.
gcc/ChangeLog:
* lra-constraints.cc (curr_insn_transform): When recreating subreg
of a const put in pool, use the original subreg mode.
char c;
rtx op = *curr_id->operand_loc[i];
rtx subreg = NULL_RTX;
- machine_mode mode = curr_operand_mode[i];
+ machine_mode op_mode = curr_operand_mode[i], mode = op_mode;
if (GET_CODE (op) == SUBREG)
{
change_p = true;
if (subreg != NULL_RTX)
- tem = gen_rtx_SUBREG (mode, tem, SUBREG_BYTE (subreg));
+ tem = gen_rtx_SUBREG (op_mode, tem, SUBREG_BYTE (subreg));
*curr_id->operand_loc[i] = tem;
lra_update_dup (curr_id, i);