From 3d709ff063605677945823394a0d6748c3206e95 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 15 Nov 1993 01:55:03 +0000 Subject: [PATCH] (store_split_bit_field): Properly load a constant VALUE into a WORD_MODE pseudo. From-SVN: r6092 --- gcc/expmed.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/expmed.c b/gcc/expmed.c index aff18612f99..69c08d5f597 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -682,15 +682,21 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) /* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that much at a time. */ int unit = MIN (align * BITS_PER_UNIT, BITS_PER_WORD); - rtx word; int bitsdone = 0; - if (GET_CODE (value) == CONST_DOUBLE - && (word = gen_lowpart_common (word_mode, value)) != 0) - value = word; - + /* If VALUE is a constant other than a CONST_INT, get it into a register in + WORD_MODE. If we can do this using gen_lowpart_common, do so. Note + that VALUE might be a floating-point constant. */ if (CONSTANT_P (value) && GET_CODE (value) != CONST_INT) - value = copy_to_mode_reg (word_mode, value); + { + rtx word = gen_lowpart_common (word_mode, value); + + if (word) + value = word; + else + value = gen_lowpart_common (word_mode, + force_reg (GET_MODE (value), value)); + } while (bitsdone < bitsize) { -- 2.30.2