aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2011-11-16 09:27:56 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2011-11-16 09:27:56 +0000
commit41272e2a5dadf20e3477b4b4451bce1fb4240d31 (patch)
tree02abdf440dc27128eba4ca2ee3aa9f9221b990a8 /gcc/expmed.c
parentf2a176dcf5386f2d7d3aaaba966bd4dd7acda1b4 (diff)
downloadgcc-41272e2a5dadf20e3477b4b4451bce1fb4240d31.zip
gcc-41272e2a5dadf20e3477b4b4451bce1fb4240d31.tar.gz
gcc-41272e2a5dadf20e3477b4b4451bce1fb4240d31.tar.bz2
re PR middle-end/50325 (76 new fails with rev. 177691)
2011-11-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> PR middle-end/50325 * expmed.c (store_bit_field_1): Use extract_bit_field on big endian targets if the source cannot be exactly covered by word mode chunks. From-SVN: r181405
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index b3e6d6d..6a9da64 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -543,7 +543,8 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
is not allowed. */
fieldmode = GET_MODE (value);
if (fieldmode == VOIDmode)
- fieldmode = smallest_mode_for_size (nwords * BITS_PER_WORD, MODE_INT);
+ fieldmode = smallest_mode_for_size (nwords *
+ BITS_PER_WORD, MODE_INT);
last = get_last_insn ();
for (i = 0; i < nwords; i++)
@@ -557,9 +558,18 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
0)
: (int) i * BITS_PER_WORD);
rtx value_word = operand_subword_force (value, wordnum, fieldmode);
-
- if (!store_bit_field_1 (op0, MIN (BITS_PER_WORD,
- bitsize - i * BITS_PER_WORD),
+ unsigned HOST_WIDE_INT new_bitsize =
+ MIN (BITS_PER_WORD, bitsize - i * BITS_PER_WORD);
+
+ /* If the remaining chunk doesn't have full wordsize we have
+ to make sure that for big endian machines the higher order
+ bits are used. */
+ if (new_bitsize < BITS_PER_WORD && BYTES_BIG_ENDIAN)
+ value_word = extract_bit_field (value_word, new_bitsize, 0,
+ true, false, NULL_RTX,
+ BLKmode, word_mode);
+
+ if (!store_bit_field_1 (op0, new_bitsize,
bitnum + bit_offset,
bitregion_start, bitregion_end,
word_mode,