]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_can_use_return_insn_p): Check for nsseregs.
authorKai Tietz <kai.tietz@onevision.com>
Fri, 30 Jan 2009 08:45:35 +0000 (08:45 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Fri, 30 Jan 2009 08:45:35 +0000 (09:45 +0100)
2009-01-30  Kai Tietz  <kai.tietz@onevision.com>

PR/39002
* config/i386/i386.c (ix86_can_use_return_insn_p): Check for nsseregs.
(ix86_expand_epilogue): Take nsseregs in account to use proper restore
method.

From-SVN: r143780

gcc/ChangeLog
gcc/config/i386/i386.c

index 4c928fcb45f417af281c58b9906672189b20cfa6..a6ae12652470e89e38bb0e668d60d52b30cdb9dd 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-30  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR/39002
+       * config/i386/i386.c (ix86_can_use_return_insn_p): Check for nsseregs.
+       (ix86_expand_epilogue): Take nsseregs in account to use proper restore
+       method.
+
 2009-01-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        * ira-color.c (allocno_reload_assign): Update comments.
index d7e56bdd96d5ac74e13ca5a73475105e62f09b88..c60ec5ab35e564cbc7da51526708b0306e9820c6 100644 (file)
@@ -7138,7 +7138,7 @@ ix86_can_use_return_insn_p (void)
     return 0;
 
   ix86_compute_frame_layout (&frame);
-  return frame.to_allocate == 0 && frame.nregs == 0;
+  return frame.to_allocate == 0 && (frame.nregs + frame.nsseregs) == 0;
 }
 \f
 /* Value should be nonzero if functions must have frame pointers.
@@ -8293,14 +8293,14 @@ ix86_expand_epilogue (int style)
      are no registers to restore.  We also use this code when TARGET_USE_LEAVE
      and there is exactly one register to pop. This heuristic may need some
      tuning in future.  */
-  if ((!sp_valid && frame.nregs <= 1)
+  if ((!sp_valid && (frame.nregs + frame.nsseregs) <= 1)
       || (TARGET_EPILOGUE_USING_MOVE
          && cfun->machine->use_fast_prologue_epilogue
-         && (frame.nregs > 1 || frame.to_allocate))
-      || (frame_pointer_needed && !frame.nregs && frame.to_allocate)
+         && ((frame.nregs + frame.nsseregs) > 1 || frame.to_allocate))
+      || (frame_pointer_needed && !(frame.nregs + frame.nsseregs) && frame.to_allocate)
       || (frame_pointer_needed && TARGET_USE_LEAVE
          && cfun->machine->use_fast_prologue_epilogue
-         && frame.nregs == 1)
+         && (frame.nregs + frame.nsseregs) == 1)
       || crtl->calls_eh_return)
     {
       /* Restore registers.  We can use ebp or esp to address the memory