aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-20 10:47:23 +0000
committerRichard Stallman <rms@gnu.org>1992-10-20 10:47:23 +0000
commit86a2c12a2b5df3baf3780ea4f7c1ad7099b47933 (patch)
tree70caf903d141c99c337e65fbe37f0ce2e23df5cc /gcc
parent2f145821b7d0956d775bc012722ddc68149ed37d (diff)
downloadgcc-86a2c12a2b5df3baf3780ea4f7c1ad7099b47933.zip
gcc-86a2c12a2b5df3baf3780ea4f7c1ad7099b47933.tar.gz
gcc-86a2c12a2b5df3baf3780ea4f7c1ad7099b47933.tar.bz2
(store_field): If trying to sign-extend a constant, use value_mode as
the mode. From-SVN: r2525
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 6808c9b..7f062ed 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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);