(store_field): If trying to sign-extend a constant, use value_mode as
authorRichard Stallman <rms@gnu.org>
Tue, 20 Oct 1992 10:47:23 +0000 (10:47 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 20 Oct 1992 10:47:23 +0000 (10:47 +0000)
the mode.

From-SVN: r2525

gcc/expr.c

index 6808c9b90ce1f30b4c7662dab9808e248dd97498..7f062ede82d3eab511d4a30a50a989546479d265 100644 (file)
@@ -2705,9 +2705,12 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
            {
              tree count;
              enum machine_mode tmode;
+
              if (unsignedp)
                return expand_and (temp, GEN_INT (width_mask), NULL_RTX);
              tmode = GET_MODE (temp);
+             if (tmode == VOIDmode)
+               tmode = value_mode;
              count = build_int_2 (GET_MODE_BITSIZE (tmode) - bitsize, 0);
              temp = expand_shift (LSHIFT_EXPR, tmode, temp, count, 0, 0);
              return expand_shift (RSHIFT_EXPR, tmode, temp, count, 0, 0);