From bc8642d6cef0782bc3181ade2ba577e53bcefc15 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" 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. From-SVN: r228621 --- 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 9f84b6ef837..42864914945 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 a24bd26c96a..4806a7cffa2 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.30.2