diff options
author | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-08 14:00:37 +0000 |
---|---|---|
committer | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-08 14:00:37 +0000 |
commit | a39dcf7072f42d64fcfd7d0892793f98d6a46ff7 (patch) | |
tree | 9be4c9674b82e6d05ebb4bf340eff7603406d2ae /gcc/config/c4x | |
parent | 3017183f686e2d7550807570232355aa0429b907 (diff) | |
download | gcc-a39dcf7072f42d64fcfd7d0892793f98d6a46ff7.tar.gz |
* config/c4x/c4x.c (c4x_legitimize_address): Don't generate a
LO_SUM address for HImode or HFmode but instead force address into
a register so that it is offsettable.
(c4x_emit_move_sequence): Handle LO_SUM immediate address.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/c4x')
-rw-r--r-- | gcc/config/c4x/c4x.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 291c22dba54..e4ee65fccae 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1015,7 +1015,6 @@ c4x_null_epilogue_p () return 0; } - int c4x_emit_move_sequence (operands, mode) rtx *operands; @@ -1030,7 +1029,15 @@ c4x_emit_move_sequence (operands, mode) && ! (stik_const_operand (op1, mode) && ! push_operand (op0, mode))) op1 = force_reg (mode, op1); - if (symbolic_operand (op1, mode)) + if (GET_CODE (op1) == LO_SUM + && GET_MODE (op1) == Pmode + && dp_reg_operand (XEXP (op1, 0), mode)) + { + /* expand_increment will sometimes create a LO_SUM immediate + address. */ + op1 = XEXP (op1, 1); + } + else if (symbolic_operand (op1, mode)) { if (TARGET_LOAD_ADDRESS) { @@ -1426,12 +1433,23 @@ c4x_legitimize_address (orig, mode) { if (GET_CODE (orig) == SYMBOL_REF) { - rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO); - - if (! TARGET_SMALL) - emit_insn (gen_set_ldp (dp_reg, orig)); - - return gen_rtx_LO_SUM (Pmode, dp_reg, orig); + if (mode == HImode || mode == HFmode) + { + /* We need to force the address into + a register so that it is offsettable. */ + rtx addr_reg = gen_reg_rtx (Pmode); + emit_move_insn (addr_reg, orig); + return addr_reg; + } + else + { + rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO); + + if (! TARGET_SMALL) + emit_insn (gen_set_ldp (dp_reg, orig)); + + return gen_rtx_LO_SUM (Pmode, dp_reg, orig); + } } return NULL_RTX; |