aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2009-01-30 08:45:35 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2009-01-30 09:45:35 +0100
commit7f1c539c954e77bb4015ab1fc64ea4966a2bf011 (patch)
tree37567d93f6ee8c6190c0acce3d93f2b01bf32a14
parente2b861f4ca4dd76b73b9230d51723f737e2bb8a1 (diff)
downloadgcc-7f1c539c954e77bb4015ab1fc64ea4966a2bf011.zip
gcc-7f1c539c954e77bb4015ab1fc64ea4966a2bf011.tar.gz
gcc-7f1c539c954e77bb4015ab1fc64ea4966a2bf011.tar.bz2
i386.c (ix86_can_use_return_insn_p): Check for nsseregs.
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4c928fc..a6ae126 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d7e56bd..c60ec5a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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;
}
/* 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