aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-02-21 15:06:16 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-02-21 15:06:16 -0800
commite3c8ea672563a4f8762b60f302a0a13c788405f7 (patch)
treea3e850cb8cef839fc826131f523c7a39605ea9d5 /gcc/explow.c
parentc1a046e50ee5d3fe4b789ed2ad51c60db6687788 (diff)
downloadgcc-e3c8ea672563a4f8762b60f302a0a13c788405f7.zip
gcc-e3c8ea672563a4f8762b60f302a0a13c788405f7.tar.gz
gcc-e3c8ea672563a4f8762b60f302a0a13c788405f7.tar.bz2
emit-rtl.c (offset_address): Use simplify_gen_binary rather than gen_rtx_PLUS to form the sum.
* emit-rtl.c (offset_address): Use simplify_gen_binary rather than gen_rtx_PLUS to form the sum. * explow.c (force_reg): Rearrange to not allocate new pseudo when force_operand returns a register. * expr.c (expand_assignment): Allow offset_rtx expansion to return a sum. Do not force addresses into registers. (expand_expr): Likewise. * simplify-rtx.c (simplify_gen_binary): Use simplify_plus_minus to canonicalize arithmetic that didn't simpify. (simplify_plus_minus): New argument force; update all callers. Don't split CONST unless we can do something with it, and wouldn't lose the constness of the operands. * config/i386/i386.c (legitimize_pic_address): Recognize UNSPECs that we generated earlier. From-SVN: r49945
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index a72a03b..7a770ee 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -732,12 +732,23 @@ force_reg (mode, x)
if (GET_CODE (x) == REG)
return x;
- temp = gen_reg_rtx (mode);
-
- if (! general_operand (x, mode))
- x = force_operand (x, NULL_RTX);
-
- insn = emit_move_insn (temp, x);
+ if (general_operand (x, mode))
+ {
+ temp = gen_reg_rtx (mode);
+ insn = emit_move_insn (temp, x);
+ }
+ else
+ {
+ temp = force_operand (x, NULL_RTX);
+ if (GET_CODE (temp) == REG)
+ insn = get_last_insn ();
+ else
+ {
+ rtx temp2 = gen_reg_rtx (mode);
+ insn = emit_move_insn (temp2, temp);
+ temp = temp2;
+ }
+ }
/* Let optimizers know that TEMP's value never changes
and that X can be substituted for it. Don't get confused
@@ -746,6 +757,7 @@ force_reg (mode, x)
&& (set = single_set (insn)) != 0
&& SET_DEST (set) == temp)
set_unique_reg_note (insn, REG_EQUAL, x);
+
return temp;
}