(store_bit_field, insv case): Don't use PUT_MODE on
authorDoug Evans <dje@gnu.org>
Thu, 3 Feb 1994 22:14:46 +0000 (22:14 +0000)
committerDoug Evans <dje@gnu.org>
Thu, 3 Feb 1994 22:14:46 +0000 (22:14 +0000)
xop0 when it is a SUBREG, generate a new SUBREG.

From-SVN: r6478

gcc/expmed.c

index 09e51adf23d9bc178b23133e521398188b70411c..ccf130e5672ef48d3f869d8d49ed450a48e9d2bb 100644 (file)
@@ -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);