From 9506aecb3b05c1a9f1f04760fc5320acbfc283b1 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 15 Oct 2012 10:48:17 +0000 Subject: expr.c (expand_expr_real_1): Do not unnecessarily copy the object in the MEM_P case. * expr.c (expand_expr_real_1) : Do not unnecessarily copy the object in the MEM_P case. From-SVN: r192452 --- gcc/expr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index 1adea93..7cf812d 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10270,10 +10270,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, { enum insn_code icode; - op0 = copy_rtx (op0); - if (TYPE_ALIGN_OK (type)) - set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type))); + { + /* ??? Copying the MEM without substantially changing it might + run afoul of the code handling volatile memory references in + store_expr, which assumes that TARGET is returned unmodified + if it has been used. */ + op0 = copy_rtx (op0); + set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type))); + } else if (mode != BLKmode && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode) /* If the target does have special handling for unaligned -- cgit v1.1