aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index ce71ae7..9ff5e5f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5211,9 +5211,13 @@ expand_assignment (tree to, tree from, bool nontemporal)
}
else
{
- rtx from_rtx
- = simplify_gen_subreg (to_mode, result,
- TYPE_MODE (TREE_TYPE (from)), 0);
+ rtx from_rtx;
+ if (MEM_P (result))
+ from_rtx = change_address (result, to_mode, NULL_RTX);
+ else
+ from_rtx
+ = simplify_gen_subreg (to_mode, result,
+ TYPE_MODE (TREE_TYPE (from)), 0);
if (from_rtx)
{
emit_move_insn (XEXP (to_rtx, 0),