From: Richard Kenner Date: Fri, 19 Nov 1993 23:48:17 +0000 (-0500) Subject: (store_field): Convert EXP to MODE before calling store_bit_field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbd6cf73c6d11877766f44038aa8e159c4265800;p=gcc.git (store_field): Convert EXP to MODE before calling store_bit_field. From-SVN: r6119 --- diff --git a/gcc/expr.c b/gcc/expr.c index f82c2abc396..95a51a32517 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3028,6 +3028,13 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, || (STRICT_ALIGNMENT && bitpos % GET_MODE_ALIGNMENT (mode) != 0)) { rtx temp = expand_expr (exp, NULL_RTX, VOIDmode, 0); + + /* Unless MODE is VOIDmode or BLKmode, convert TEMP to + MODE. */ + if (mode != VOIDmode && mode != BLKmode + && mode != TYPE_MODE (TREE_TYPE (exp))) + temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1); + /* Store the value in the bitfield. */ store_bit_field (target, bitsize, bitpos, mode, temp, align, total_size); if (value_mode != VOIDmode)