diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-16 10:59:15 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-16 10:59:15 +0000 |
commit | 78defff52b5c29a83dfdd0a3f22003b4f5180d0e (patch) | |
tree | 0b00a805101ffc0866f51c0f8db081dde5a27ea9 /gcc/regrename.c | |
parent | 1e612551ff65c1d5fc99b5e17dc19977c30e1fd4 (diff) | |
download | gcc-78defff52b5c29a83dfdd0a3f22003b4f5180d0e.tar.gz |
* expr.c (emit_move_insn_1): Handle arbitrary moves that are
the same size as a word.
* regrename.c (find_oldest_value_reg): Take WORDS_BIG_ENDIAN /
BYTES_BIG_ENDIAN into account.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regrename.c')
-rw-r--r-- | gcc/regrename.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c index ffe170e2795..532d5753df3 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1335,14 +1335,26 @@ find_oldest_value_reg (class, reg, vd) } for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno) + { + enum machine_mode oldmode = vd->e[i].mode; + if (TEST_HARD_REG_BIT (reg_class_contents[class], i) - && (vd->e[i].mode == mode - || mode_change_ok (vd->e[i].mode, mode, i))) + && (oldmode == mode + || mode_change_ok (oldmode, mode, i))) { - rtx new = gen_rtx_raw_REG (mode, i); + int offset = GET_MODE_SIZE (oldmode) - GET_MODE_SIZE (mode); + int byteoffset = offset % UNITS_PER_WORD; + int wordoffset = offset - byteoffset; + rtx new; + + offset = ((WORDS_BIG_ENDIAN ? wordoffset : 0) + + (BYTES_BIG_ENDIAN ? byteoffset : 0)); + new = (gen_rtx_raw_REG + (mode, i + subreg_regno_offset (i, oldmode, offset, mode))); ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg); return new; } + } return NULL_RTX; } |