diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2005-05-23 16:43:06 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2005-05-23 16:43:06 +0000 |
commit | 22a707a49732eb577015de4e9fd921f17a18a647 (patch) | |
tree | 75fe125e64472287e5cab8c642b6da6eefe175a9 | |
parent | 52f6de6c7bcf4026fa5ec64d21993b333aa58d5f (diff) | |
download | gcc-22a707a49732eb577015de4e9fd921f17a18a647.zip gcc-22a707a49732eb577015de4e9fd921f17a18a647.tar.gz gcc-22a707a49732eb577015de4e9fd921f17a18a647.tar.bz2 |
s390.c (s390_optimize_prologue): Don't replace an insn saving less registers than the replacement.
2005-05-23 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_optimize_prologue): Don't replace an insn
saving less registers than the replacement.
From-SVN: r100081
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 34 |
2 files changed, 17 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25e9ec32..783c56d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-05-23 Andreas Krebbel <krebbel1@de.ibm.com> + + * config/s390/s390.c (s390_optimize_prologue): Don't replace an insn + saving less registers than the replacement. + 2005-05-23 Jan Hubicka <jh@suse.cz> * tree-flow.h (stmt_ann_d): Kill GTY ((skip)) mark on BB. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 7cf56cc..9de797a 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -7951,6 +7951,10 @@ s390_optimize_prologue (void) if (GET_CODE (base) != REG || off < 0) continue; + if (cfun_frame_layout.first_save_gpr != -1 + && (cfun_frame_layout.first_save_gpr < first + || cfun_frame_layout.last_save_gpr > last)) + continue; if (REGNO (base) != STACK_POINTER_REGNUM && REGNO (base) != HARD_FRAME_POINTER_REGNUM) continue; @@ -7972,7 +7976,8 @@ s390_optimize_prologue (void) continue; } - if (GET_CODE (PATTERN (insn)) == SET + if (cfun_frame_layout.first_save_gpr == -1 + && GET_CODE (PATTERN (insn)) == SET && GET_CODE (SET_SRC (PATTERN (insn))) == REG && (REGNO (SET_SRC (PATTERN (insn))) == BASE_REGNUM || (!TARGET_CPU_ZARCH @@ -7990,16 +7995,6 @@ s390_optimize_prologue (void) if (REGNO (base) != STACK_POINTER_REGNUM && REGNO (base) != HARD_FRAME_POINTER_REGNUM) continue; - if (cfun_frame_layout.first_save_gpr != -1) - { - new_insn = save_gprs (base, - off + (cfun_frame_layout.first_save_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_save_gpr, - cfun_frame_layout.last_save_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } remove_insn (insn); continue; @@ -8017,6 +8012,10 @@ s390_optimize_prologue (void) if (GET_CODE (base) != REG || off < 0) continue; + if (cfun_frame_layout.first_restore_gpr != -1 + && (cfun_frame_layout.first_restore_gpr < first + || cfun_frame_layout.last_restore_gpr > last)) + continue; if (REGNO (base) != STACK_POINTER_REGNUM && REGNO (base) != HARD_FRAME_POINTER_REGNUM) continue; @@ -8038,7 +8037,8 @@ s390_optimize_prologue (void) continue; } - if (GET_CODE (PATTERN (insn)) == SET + if (cfun_frame_layout.first_restore_gpr == -1 + && GET_CODE (PATTERN (insn)) == SET && GET_CODE (SET_DEST (PATTERN (insn))) == REG && (REGNO (SET_DEST (PATTERN (insn))) == BASE_REGNUM || (!TARGET_CPU_ZARCH @@ -8056,16 +8056,6 @@ s390_optimize_prologue (void) if (REGNO (base) != STACK_POINTER_REGNUM && REGNO (base) != HARD_FRAME_POINTER_REGNUM) continue; - if (cfun_frame_layout.first_restore_gpr != -1) - { - new_insn = restore_gprs (base, - off + (cfun_frame_layout.first_restore_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_restore_gpr, - cfun_frame_layout.last_restore_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } remove_insn (insn); continue; |