From bac7cdfd7d0dfa7d9bb7065faf11882cc1922821 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 3 Feb 1994 22:14:46 +0000 Subject: [PATCH] (store_bit_field, insv case): Don't use PUT_MODE on xop0 when it is a SUBREG, generate a new SUBREG. From-SVN: r6478 --- gcc/expmed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/expmed.c b/gcc/expmed.c index 09e51adf23d..ccf130e5672 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -421,7 +421,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) /* If xop0 is a register, we need it in MAXMODE to make it acceptable to the format of insv. */ if (GET_CODE (xop0) == SUBREG) - PUT_MODE (xop0, maxmode); + /* We can't just change the mode, because this might clobber op0, + and we will need the original value of op0 if insv fails. */ + xop0 = gen_rtx (SUBREG, maxmode, SUBREG_REG (xop0), SUBREG_WORD (xop0)); if (GET_CODE (xop0) == REG && GET_MODE (xop0) != maxmode) xop0 = gen_rtx (SUBREG, maxmode, xop0, 0); -- 2.30.2