aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAurelien Buhrig <aurelien.buhrig.gcc@gmail.com>2012-03-27 20:50:16 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-03-27 20:50:16 +0000
commit00d6b19abde74e659b0572c9bbee1a1fa75d7e2c (patch)
tree73769ec7025d31af9ae6e54d533e687dcfd17ed5 /gcc
parent28d5436f07e18147d0d2185b48a33d69e8c43ce5 (diff)
downloadgcc-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')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expmed.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc4f0cb..a7a7661 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-27 Aurelien Buhrig <aurelien.buhrig.gcc@gmail.com>
+
+ PR middle-end/51893
+ * expmed.c (store_bit_field_1): Fix wordnum value for big-endian
+ targets.
+
2012-03-27 Oleg Endo <olegendo@gcc.gnu.org>
PR target/50751
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,