From ad83e87b61e9776115ac880ec0832cb6af46c928 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Wed, 31 Aug 1994 16:29:53 -0700 Subject: [PATCH] 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 --- gcc/expmed.c | 13 ++++++++++--- 1 file 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, -- 2.7.4