diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-05-17 21:24:12 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-05-17 21:24:12 +0000 |
commit | 981a7aca054114de335902b83fedd183c5e7f6c6 (patch) | |
tree | c53d1a128f09f0e27d67b8ca83f374ea2e6ce629 /gcc/expmed.c | |
parent | 7b0a0dd40d8e785d186d0debd8127992b2da838b (diff) | |
download | gcc-981a7aca054114de335902b83fedd183c5e7f6c6.tar.gz |
(store_split_bit_field): Don't assume the alignment of VALUE is the
same as the record.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12017 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 955c4163177..be27f855ae8 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -781,10 +781,19 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) else /* The args are chosen so that the last part includes the lsb. Give extract_bit_field the value it needs (with - endianness compensation) to fetch the piece we want. */ - part = extract_fixed_bit_field (word_mode, value, 0, thissize, - total_bits - bitsize + bitsdone, - NULL_RTX, 1, align); + endianness compensation) to fetch the piece we want. + + ??? We have no idea what the alignment of VALUE is, so + we have to use a guess. */ + part + = extract_fixed_bit_field + (word_mode, value, 0, thissize, + total_bits - bitsize + bitsdone, NULL_RTX, 1, + GET_MODE (value) == VOIDmode + ? UNITS_PER_WORD + : (GET_MODE (value) == BLKmode + ? 1 + : GET_MODE_ALIGNMENT (GET_MODE (value)) / BITS_PER_UNIT)); } else { @@ -794,8 +803,14 @@ store_split_bit_field (op0, bitsize, bitpos, value, align) >> bitsdone) & (((HOST_WIDE_INT) 1 << thissize) - 1)); else - part = extract_fixed_bit_field (word_mode, value, 0, thissize, - bitsdone, NULL_RTX, 1, align); + part + = extract_fixed_bit_field + (word_mode, value, 0, thissize, bitsdone, NULL_RTX, 1, + GET_MODE (value) == VOIDmode + ? UNITS_PER_WORD + : (GET_MODE (value) == BLKmode + ? 1 + : GET_MODE_ALIGNMENT (GET_MODE (value)) / BITS_PER_UNIT)); } /* If OP0 is a register, then handle OFFSET here. |