re PR middle-end/50325 (76 new fails with rev. 177691)

gcc/
2012-01-17  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	PR middle-end/50325
	PR middle-end/51192
	* optabs.h (simplify_expand_binop): Declare.
	* optabs.c (simplify_expand_binop): Make global.
	* expmed.c (store_bit_field_1): Use simplify_expand_binop on big
	endian targets if the source cannot be exactly covered by word
	mode chunks.

Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>

From-SVN: r183262
This commit is contained in:
Andreas Krebbel 2012-01-17 20:37:46 +00:00 committed by Richard Sandiford
parent cd2705aade
commit 3bdb97b8b9
4 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,14 @@
2012-01-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Richard Sandiford <rdsandiford@googlemail.com>
PR middle-end/50325
PR middle-end/51192
* optabs.h (simplify_expand_binop): Declare.
* optabs.c (simplify_expand_binop): Make global.
* expmed.c (store_bit_field_1): Use simplify_expand_binop on big
endian targets if the source cannot be exactly covered by word
mode chunks.
2012-01-17 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/51872

View File

@ -557,9 +557,21 @@ 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);
unsigned HOST_WIDE_INT new_bitsize =
MIN (BITS_PER_WORD, bitsize - i * BITS_PER_WORD);
if (!store_bit_field_1 (op0, 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 && !backwards)
value_word = simplify_expand_binop (word_mode, lshr_optab,
value_word,
GEN_INT (BITS_PER_WORD
- new_bitsize),
NULL_RTX, true,
OPTAB_LIB_WIDEN);
if (!store_bit_field_1 (op0, new_bitsize,
bitnum + bit_offset,
bitregion_start, bitregion_end,
word_mode,

View File

@ -659,7 +659,7 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
calculated at compile time. The arguments and return value are
otherwise the same as for expand_binop. */
static rtx
rtx
simplify_expand_binop (enum machine_mode mode, optab binoptab,
rtx op0, rtx op1, rtx target, int unsignedp,
enum optab_methods methods)

View File

@ -859,6 +859,10 @@ extern rtx expand_ternary_op (enum machine_mode mode, optab ternary_optab,
extern rtx expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
enum optab_methods);
extern rtx simplify_expand_binop (enum machine_mode mode, optab binoptab,
rtx op0, rtx op1, rtx target, int unsignedp,
enum optab_methods methods);
extern bool force_expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
enum optab_methods);