diff options
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/expr.c | 6 | ||||
-rw-r--r-- | gcc/regrename.c | 18 |
3 files changed, 26 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e326efc5f30..e463efd87e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Tue Jul 16 11:57:45 2002 J"orn Rennecke <joern.rennecke@superh.com> + + * 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. + Tue Jul 16 12:22:44 CEST 2002 Jan Hubicka <jh@suse.cz> * i386.md (prefetch): Fix for 64bit mode. diff --git a/gcc/expr.c b/gcc/expr.c index 870a4c527bf..7b5810c617c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3058,10 +3058,10 @@ emit_move_insn_1 (x, y) return get_last_insn (); } - /* This will handle any multi-word mode that lacks a move_insn pattern. - However, you will get better code if you define such patterns, + /* This will handle any multi-word or full-word mode that lacks a move_insn + pattern. However, you will get better code if you define such patterns, even if they must turn into multiple assembler instructions. */ - else if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + else if (GET_MODE_SIZE (mode) >= UNITS_PER_WORD) { rtx last_insn = 0; rtx seq, inner; 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; } |