From 27f0420028fe07ce66eba2e48d00cf018fcd2989 Mon Sep 17 00:00:00 2001 From: hjl Date: Thu, 8 Oct 2015 18:57:11 +0000 Subject: [PATCH] Round up the SSE register save area only if needed There is is no point to round up the SSE register save area to 16 bytes if the incoming stack boundary is less than 16 bytes. * config/i386/i386.c (ix86_compute_frame_layout): Round up the SSE register save area to 16 bytes only if the incoming stack boundary is no less than 16 bytes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228621 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f84b6ef8372..428649149456 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-08 H.J. Lu + + * config/i386/i386.c (ix86_compute_frame_layout): Round up the + SSE register save area to 16 bytes only if the incoming stack + boundary is no less than 16 bytes. + 2015-10-08 Jeff Law * tree-ssa-phiopt.c (factor_out_conversion): Add missing calls to diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a24bd26c96a0..4806a7cffa29 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11383,9 +11383,14 @@ ix86_compute_frame_layout (struct ix86_frame *frame) if (frame->nsseregs) { /* The only ABI that has saved SSE registers (Win64) also has a - 16-byte aligned default stack, and thus we don't need to be - within the re-aligned local stack frame to save them. */ - offset = ROUND_UP (offset, 16); + 16-byte aligned default stack, and thus we don't need to be + within the re-aligned local stack frame to save them. In case + incoming stack boundary is aligned to less than 16 bytes, + unaligned move of SSE register will be emitted, so there is + no point to round up the SSE register save area outside the + re-aligned local stack frame to 16 bytes. */ + if (ix86_incoming_stack_boundary >= 128) + offset = ROUND_UP (offset, 16); offset += frame->nsseregs * 16; } frame->sse_reg_save_offset = offset; -- 2.47.2