summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/expr.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
committerkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
commitd7b0b4f3c615794b038ed6a64e85e9621c90bc91 (patch)
tree9f886db2860fe9f635cc7c5892af5f347ab96fb5 /contrib/gcc/expr.c
parentf2254cf7022e4e6909272699c8e1f774b7e4e3f1 (diff)
parent2156e40a831a8e0ab68e4bc091c2940bf46ca6df (diff)
downloadFreeBSD-src-d7b0b4f3c615794b038ed6a64e85e9621c90bc91.zip
FreeBSD-src-d7b0b4f3c615794b038ed6a64e85e9621c90bc91.tar.gz
This commit was generated by cvs2svn to compensate for changes in r146895,
which included commits to RCS files with non-trunk default branches.
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