aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.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/expr.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/expr.c')
-rw-r--r--gcc/expr.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index a903b14..b730435 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3659,7 +3659,7 @@ expand_assignment (to, from, want_value, suggest_reg)
if (offset != 0)
{
- rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
+ rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM);
if (GET_CODE (to_rtx) != MEM)
abort ();
@@ -3682,15 +3682,7 @@ expand_assignment (to, from, want_value, suggest_reg)
&& (bitsize % GET_MODE_ALIGNMENT (mode1)) == 0
&& MEM_ALIGN (to_rtx) == GET_MODE_ALIGNMENT (mode1))
{
- rtx temp
- = adjust_address (to_rtx, mode1, bitpos / BITS_PER_UNIT);
-
- if (GET_CODE (XEXP (temp, 0)) == REG)
- to_rtx = temp;
- else
- to_rtx = (replace_equiv_address
- (to_rtx, force_reg (GET_MODE (XEXP (temp, 0)),
- XEXP (temp, 0))));
+ to_rtx = adjust_address (to_rtx, mode1, bitpos / BITS_PER_UNIT);
bitpos = 0;
}
@@ -6852,7 +6844,7 @@ expand_expr (exp, target, tmode, modifier)
if (offset != 0)
{
- rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
+ rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM);
/* If this object is in a register, put it into memory.
This case can't occur in C, but can in Ada if we have
@@ -6902,15 +6894,7 @@ expand_expr (exp, target, tmode, modifier)
&& (bitsize % GET_MODE_ALIGNMENT (mode1)) == 0
&& MEM_ALIGN (op0) == GET_MODE_ALIGNMENT (mode1))
{
- rtx temp = adjust_address (op0, mode1, bitpos / BITS_PER_UNIT);
-
- if (GET_CODE (XEXP (temp, 0)) == REG)
- op0 = temp;
- else
- op0 = (replace_equiv_address
- (op0,
- force_reg (GET_MODE (XEXP (temp, 0)),
- XEXP (temp, 0))));
+ op0 = adjust_address (op0, mode1, bitpos / BITS_PER_UNIT);
bitpos = 0;
}