diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-02-15 12:46:10 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-02-15 12:46:10 +0100 |
commit | c95f9494fe67feaccfbb33f7d066f21427ce8ed6 (patch) | |
tree | 5c1c12a1349ada04e8ede9477afcd8787405f475 /gcc/config | |
parent | c1e2901ed0757327c8fe45ca03f548a9e07f3372 (diff) | |
download | gcc-c95f9494fe67feaccfbb33f7d066f21427ce8ed6.zip gcc-c95f9494fe67feaccfbb33f7d066f21427ce8ed6.tar.gz gcc-c95f9494fe67feaccfbb33f7d066f21427ce8ed6.tar.bz2 |
re PR middle-end/47581 (Unnecessary adjustments to stack pointer)
PR middle-end/47581
* config/i386/i386.c (ix86_compute_frame_size): Don't align offset
if frame size is 0 in a leaf function.
* gcc.target/i386/pr47581.c: New test.
From-SVN: r170170
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 12c7062..9956366 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9307,7 +9307,13 @@ ix86_compute_frame_layout (struct ix86_frame *frame) offset += frame->va_arg_size; /* Align start of frame for local function. */ - offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed; + if (stack_realign_fp + || offset != frame->sse_reg_save_offset + || size != 0 + || !current_function_is_leaf + || cfun->calls_alloca + || ix86_current_function_calls_tls_descriptor) + offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed; /* Frame pointer points here. */ frame->frame_pointer_offset = offset; |