s390.c (s390_emit_epilogue): Always restore registers needed by the compiler...
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 25 Apr 2002 21:26:04 +0000 (21:26 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Thu, 25 Apr 2002 21:26:04 +0000 (21:26 +0000)
* config/s390/s390.c (s390_emit_epilogue): Always restore registers
needed by the compiler, even if they are used as global regs.

From-SVN: r52768

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

index 855042c..01b2e44 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-25  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * config/s390/s390.c (s390_emit_epilogue): Always restore registers
+       needed by the compiler, even if they are used as global regs.
+
 2002-04-25  Matt Hiller  <hiller@redhat.com>
 
        * mips.c (mips_class_max_nregs, mips_register_move_cost): New
index c052e04..ce51bcf 100644 (file)
@@ -3255,6 +3255,14 @@ s390_emit_epilogue ()
           i <= frame.last_save_gpr;
           i++)
        {
+         /* These registers are special and need to be 
+            restored in any case.  */
+         if (i == STACK_POINTER_REGNUM 
+              || i == RETURN_REGNUM
+              || i == BASE_REGISTER 
+              || (flag_pic && i == PIC_OFFSET_TABLE_REGNUM))
+           continue;
+
          if (global_regs[i])
            {
              addr = plus_constant (frame_pointer,