From 0b7ae56590f7d722c275057bb1c076ec16623d01 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 28 May 2002 13:27:45 -0700 Subject: [PATCH] i386.c (ix86_compute_frame_layout): Do not add bottom alignment for leaf functions. * config/i386/i386.c (ix86_compute_frame_layout): Do not add bottom alignment for leaf functions. From-SVN: r53965 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 356c1b6b7a4..54e828f8607 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-28 Richard Henderson + + * config/i386/i386.c (ix86_compute_frame_layout): Do not add + bottom alignment for leaf functions. + 2002-05-28 Zack Weinberg * config/pa/milli32.S, config/pa/lib1funcs.asm, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index cf2def2393b..39831af4745 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4138,8 +4138,9 @@ ix86_compute_frame_layout (frame) offset += size; - /* Add outgoing arguments area. */ - if (ACCUMULATE_OUTGOING_ARGS) + /* Add outgoing arguments area. Can be skipped if we eliminated + all the function calls as dead code. */ + if (ACCUMULATE_OUTGOING_ARGS && !current_function_is_leaf) { offset += current_function_outgoing_args_size; frame->outgoing_arguments_size = current_function_outgoing_args_size; @@ -4147,9 +4148,12 @@ ix86_compute_frame_layout (frame) else frame->outgoing_arguments_size = 0; - /* Align stack boundary. */ - frame->padding2 = ((offset + preferred_alignment - 1) - & -preferred_alignment) - offset; + /* Align stack boundary. Only needed if we're calling another function. */ + if (!current_function_is_leaf) + frame->padding2 = ((offset + preferred_alignment - 1) + & -preferred_alignment) - offset; + else + frame->padding2 = 0; offset += frame->padding2; -- 2.30.2