diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1994-08-31 16:29:53 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1994-08-31 16:29:53 -0700 |
commit | ad83e87b61e9776115ac880ec0832cb6af46c928 (patch) | |
tree | 2c19c9d0b992802f376aeb965c2a80fdd18983e6 | |
parent | 318b149cf75ee0b34fa2955e8a822682e0d0c33d (diff) | |
download | gcc-ad83e87b61e9776115ac880ec0832cb6af46c928.zip gcc-ad83e87b61e9776115ac880ec0832cb6af46c928.tar.gz gcc-ad83e87b61e9776115ac880ec0832cb6af46c928.tar.bz2 |
expmed.c (store_bit_field): Semi-revert Aug 25 change: Make it apply only for BLKmode, not integral modes.
* expmed.c (store_bit_field): Semi-revert Aug 25 change:
Make it apply only for BLKmode, not integral modes.
From-SVN: r8007
-rw-r--r-- | gcc/expmed.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 8661259..45d0dfe 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -299,7 +299,10 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) /* Here we transfer the words of the field in the order least significant first. This is because the most significant word is the one which may - be less than full. */ + be less than full. + However, only do that if the value is not BLKmode. */ + + int backwards = WORDS_BIG_ENDIAN && fieldmode != BLKmode; int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD; int i; @@ -313,8 +316,12 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) for (i = 0; i < nwords; i++) { - int wordnum = i; - int bit_offset = i * BITS_PER_WORD; + /* If I is 0, use the low-order word in both field and target; + if I is 1, use the next to lowest word; and so on. */ + int wordnum = (backwards ? nwords - i - 1 : i); + int bit_offset = (backwards + ? MAX (bitsize - (i + 1) * BITS_PER_WORD, 0) + : i * BITS_PER_WORD); store_bit_field (op0, MIN (BITS_PER_WORD, bitsize - i * BITS_PER_WORD), bitnum + bit_offset, word_mode, |