summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/expr.c')
-rw-r--r--contrib/gcc/expr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/gcc/expr.c b/contrib/gcc/expr.c
index aa80ae6..fcb5b0c 100644
--- a/contrib/gcc/expr.c
+++ b/contrib/gcc/expr.c
@@ -8107,7 +8107,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
/* At this point, a MEM target is no longer useful; we will get better
code without it. */
- if (GET_CODE (target) == MEM)
+ if (! REG_P (target))
target = gen_reg_rtx (mode);
/* If op1 was placed in target, swap op0 and op1. */
@@ -8118,6 +8118,11 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
op1 = tem;
}
+ /* We generate better code and avoid problems with op1 mentioning
+ target by forcing op1 into a pseudo if it isn't a constant. */
+ if (! CONSTANT_P (op1))
+ op1 = force_reg (mode, op1);
+
if (target != op0)
emit_move_insn (target, op0);
OpenPOWER on IntegriCloud