diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-21 23:06:16 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-21 23:06:16 +0000 |
commit | fac6aae60a6c98e1f11b16661387c5cc8581eea0 (patch) | |
tree | a3e850cb8cef839fc826131f523c7a39605ea9d5 /gcc/explow.c | |
parent | bfba49c61e39a87f50ab921d83feabe6e88e331d (diff) | |
download | gcc-fac6aae60a6c98e1f11b16661387c5cc8581eea0.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49945 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index a72a03be64c..7a770ee897c 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; } |