]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pa.c (hppa_expand_epilogue): Correctly handle restore of %rp for functions with a...
authorJeffrey A. Law <law@snake.cs.utah.edu>
Tue, 2 May 1995 05:27:01 +0000 (23:27 -0600)
committerJeff Law <law@gcc.gnu.org>
Tue, 2 May 1995 05:27:01 +0000 (23:27 -0600)
Tue May  2 01:25:29 1995  Jeffrey A. Law  <law@snake.cs.utah.edu>

* pa.c (hppa_expand_epilogue): Correctly handle restore of %rp
for functions with a stack size of exactly 8kbytes and no frame
pointer.

From-SVN: r9561

gcc/config/pa/pa.c

index ab43981c203ebb6f2349ed033e3288c6b5c08f1f..f6a6960ca472df1a291d4956509ed9fb5d275d8d 100644 (file)
@@ -2439,8 +2439,15 @@ hppa_expand_epilogue ()
       set_reg_plus_d (STACK_POINTER_REGNUM,
                      STACK_POINTER_REGNUM,
                      - actual_fsize);
-      /* Uses value left over in %r1 by set_reg_plus_d.  */
-      load_reg (2, - (actual_fsize + 20 + ((- actual_fsize) & ~0x7ff)), 1);
+
+      /* This used to try and be clever by not depending on the value in
+        %r30 and instead use the value held in %r1 (so that the 2nd insn
+        which sets %r30 could be put in the delay slot of the return insn).
+       
+        That won't work since if the stack is exactly 8k set_reg_plus_d
+        doesn't set %r1, just %r30.  */
+      load_reg (2, - (actual_fsize + 20 + ((- actual_fsize) & ~0x7ff)),
+               STACK_POINTER_REGNUM);
     }
 
   /* Reset stack pointer (and possibly frame pointer).  The stack */