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
This commit is contained in:
Aurelien Buhrig 2012-03-27 20:50:16 +00:00 committed by Eric Botcazou
parent 28d5436f07
commit 00d6b19abd
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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,