Message ID | 3632647.sGSbmzomM5@polaris |
---|---|
State | New |
Headers | show |
> 2012-11-19 Eric Botcazou <ebotcazou@adacore.com> > > * config/ia64/ia64.c (ia64_compute_frame_size): Allocate the scratch > area if the function allocates dynamic stack space. > (ia64_initial_elimination_offset): Adjust offsets to above change. Ping: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01617.html Thanks in advance.
On 2012-11-19 16:12, Eric Botcazou wrote: > 2012-11-19 Eric Botcazou <ebotcazou@adacore.com> > > * config/ia64/ia64.c (ia64_compute_frame_size): Allocate the scratch > area if the function allocates dynamic stack space. > (ia64_initial_elimination_offset): Adjust offsets to above change. Ok for any branch. r~
On Mon, 2012-12-03 at 13:16 +0100, Eric Botcazou wrote: > > 2012-11-19 Eric Botcazou <ebotcazou@adacore.com> > > > > * config/ia64/ia64.c (ia64_compute_frame_size): Allocate the scratch > > area if the function allocates dynamic stack space. > > (ia64_initial_elimination_offset): Adjust offsets to above change. > > Ping: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01617.html > > Thanks in advance. Eric, this looks OK to me. As for back porting it, that is OK with me too as long as it is OK with the release/branch managers. Steve Ellcey sellcey@mips.com
Index: config/ia64/ia64.c =================================================================== --- config/ia64/ia64.c (revision 193596) +++ config/ia64/ia64.c (working copy) @@ -2885,8 +2885,10 @@ ia64_compute_frame_size (HOST_WIDE_INT s /* We always use the 16-byte scratch area provided by the caller, but if we are a leaf function, there's no one to which we need to provide - a scratch area. */ - if (crtl->is_leaf) + a scratch area. However, if the function allocates dynamic stack space, + the dynamic offset is computed early and contains STACK_POINTER_OFFSET, + so we need to cope. */ + if (crtl->is_leaf && !cfun->calls_alloca) total_size = MAX (0, total_size - 16); current_frame_info.total_size = total_size; @@ -2920,18 +2922,15 @@ ia64_initial_elimination_offset (int fro switch (to) { case HARD_FRAME_POINTER_REGNUM: - if (crtl->is_leaf) - offset = -current_frame_info.total_size; - else - offset = -(current_frame_info.total_size - - crtl->outgoing_args_size - 16); + offset = -current_frame_info.total_size; + if (!crtl->is_leaf || cfun->calls_alloca) + offset += 16 + crtl->outgoing_args_size; break; case STACK_POINTER_REGNUM: - if (crtl->is_leaf) - offset = 0; - else - offset = 16 + crtl->outgoing_args_size; + offset = 0; + if (!crtl->is_leaf || cfun->calls_alloca) + offset += 16 + crtl->outgoing_args_size; break; default: