OSDN Git Service

2005-05-23 Andreas Krebbel <krebbel1@de.ibm.com>
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 May 2005 16:43:06 +0000 (16:43 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 May 2005 16:43:06 +0000 (16:43 +0000)
* config/s390/s390.c (s390_optimize_prologue): Don't replace an insn
saving less registers than the replacement.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100081 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.c

index 25e9ec3..783c56d 100644 (file)
@@ -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.
index 7cf56cc..9de797a 100644 (file)
@@ -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;