diff options
author | Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com> | 2012-03-27 20:50:16 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2012-03-27 20:50:16 +0000 |
commit | 00d6b19abde74e659b0572c9bbee1a1fa75d7e2c (patch) | |
tree | 73769ec7025d31af9ae6e54d533e687dcfd17ed5 /gcc/expmed.c | |
parent | 28d5436f07e18147d0d2185b48a33d69e8c43ce5 (diff) | |
download | gcc-00d6b19abde74e659b0572c9bbee1a1fa75d7e2c.zip gcc-00d6b19abde74e659b0572c9bbee1a1fa75d7e2c.tar.gz gcc-00d6b19abde74e659b0572c9bbee1a1fa75d7e2c.tar.bz2 |
re PR middle-end/51893 (Wrong subword index computation in store_bit_field_1 on BIG_ENDIAN targets)
PR middle-end/51893
* expmed.c (store_bit_field_1): Fix wordnum value for big-endian
targets.
From-SVN: r185897
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 54e51dc..5eea2ab 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -550,7 +550,10 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, { /* 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. */ - unsigned int wordnum = (backwards ? nwords - i - 1 : i); + unsigned int wordnum = (backwards + ? GET_MODE_SIZE (fieldmode) / UNITS_PER_WORD + - i - 1 + : i); unsigned int bit_offset = (backwards ? MAX ((int) bitsize - ((int) i + 1) * BITS_PER_WORD, |