aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-01-24 16:24:18 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-01-24 16:24:18 -0800
commit9033081d38c855d7cf191d2b111c9e410297d5ca (patch)
tree6e93201056b7b67d8e37669e4c71b3aaf0e618d4 /gcc/expmed.c
parent648a09eed9f2b429e36353da9f603e79caa6c18e (diff)
downloadgcc-9033081d38c855d7cf191d2b111c9e410297d5ca.zip
gcc-9033081d38c855d7cf191d2b111c9e410297d5ca.tar.gz
gcc-9033081d38c855d7cf191d2b111c9e410297d5ca.tar.bz2
(store_split_bit_field): For BYTES_BIG_ENDIAN, only
pad on left if value not in memory. From-SVN: r6429
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 4c06fb4..f20fb18 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -721,11 +721,19 @@ store_split_bit_field (op0, bitsize, bitpos, value, align)
>> (bitsize - bitsdone - thissize))
& (((HOST_WIDE_INT) 1 << thissize) - 1));
else
- /* The args are chosen so that the last part
- includes the lsb. */
- part = extract_fixed_bit_field (word_mode, value, 0, thissize,
- BITS_PER_WORD - bitsize + bitsdone,
- NULL_RTX, 1, align);
+ {
+ /* The args are chosen so that the last part
+ includes the lsb. */
+ int bit_offset = 0;
+ /* If the value isn't in memory, then it must be right aligned
+ if a register, so skip past the padding on the left. If it
+ is in memory, then there is no padding on the left. */
+ if (GET_CODE (value) != MEM)
+ bit_offset = BITS_PER_WORD - bitsize;
+ part = extract_fixed_bit_field (word_mode, value, 0, thissize,
+ bit_offset + bitsdone,
+ NULL_RTX, 1, align);
+ }
#else
/* Fetch successively more significant portions. */
if (GET_CODE (value) == CONST_INT)