aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-11-15 01:55:03 +0000
committerRichard Stallman <rms@gnu.org>1993-11-15 01:55:03 +0000
commit3d709ff063605677945823394a0d6748c3206e95 (patch)
tree1eccd3d0d94065f592745f13138aa55252379dda /gcc
parentba83886f6e93fe5152c8f5d2df7e8ba845609bfd (diff)
downloadgcc-3d709ff063605677945823394a0d6748c3206e95.zip
gcc-3d709ff063605677945823394a0d6748c3206e95.tar.gz
gcc-3d709ff063605677945823394a0d6748c3206e95.tar.bz2
(store_split_bit_field): Properly load a constant VALUE
into a WORD_MODE pseudo. From-SVN: r6092
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expmed.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index aff1861..69c08d5 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)
{