This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix some mem-ref fallout
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 5 Aug 2010 18:36:56 +0200 (CEST)
- Subject: [PATCH] Fix some mem-ref fallout
We need to use store_bit_field, not emit_block_move when the
source is not a MEM.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2010-08-05 Richard Guenther <rguenther@suse.de>
* expr.c (store_expr): Use emit_block_move only if both
source and target are MEMs. Use store_bit_field if only
the target is a MEM.
Index: gcc/expr.c
===================================================================
*** gcc/expr.c (revision 162913)
--- gcc/expr.c (working copy)
*************** store_expr (tree exp, rtx target, int ca
*** 4752,4762 ****
{
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
if (GET_MODE (target) == BLKmode
! || GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
(call_param_p
? BLOCK_OP_CALL_PARM
: BLOCK_OP_NORMAL));
else
convert_move (target, temp, unsignedp);
}
--- 4752,4765 ----
{
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
if (GET_MODE (target) == BLKmode
! && GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
(call_param_p
? BLOCK_OP_CALL_PARM
: BLOCK_OP_NORMAL));
+ else if (GET_MODE (target) == BLKmode)
+ store_bit_field (target, INTVAL (expr_size (exp)) * BITS_PER_UNIT,
+ 0, GET_MODE (temp), temp);
else
convert_move (target, temp, unsignedp);
}