aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-12-04 09:05:49 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-12-04 09:05:49 +0000
commit44bd7f65250cd0814b346679ef801ae0722e0483 (patch)
tree817ce919e43053dca36bf49e122166abae711f60 /gcc/config
parent8c4d267c6e834ccc20632d2c9077d7622b8145cf (diff)
downloadgcc-44bd7f65250cd0814b346679ef801ae0722e0483.zip
gcc-44bd7f65250cd0814b346679ef801ae0722e0483.tar.gz
gcc-44bd7f65250cd0814b346679ef801ae0722e0483.tar.bz2
ia64.c (ia64_compute_frame_size): Allocate the scratch area if the function allocates dynamic stack space.
* 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. From-SVN: r194121
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/ia64/ia64.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 9a7528f..3b19b98 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -2885,8 +2885,10 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
/* 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 from, int to)
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: