aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2010-10-01 00:04:18 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2010-10-01 00:04:18 +0000
commite631262b77b5ce1aba09a822e30f2ba2882b0ba6 (patch)
treea4e3b1489efb13d8e244e1f2572b20450d010df9
parent0e247093e0be627a46d1fc6d51c3afe6ca24754b (diff)
downloadgcc-e631262b77b5ce1aba09a822e30f2ba2882b0ba6.zip
gcc-e631262b77b5ce1aba09a822e30f2ba2882b0ba6.tar.gz
gcc-e631262b77b5ce1aba09a822e30f2ba2882b0ba6.tar.bz2
sh.c (sh_expand_prologue): Set current_function_static_stack_size.
* config/sh/sh.c (sh_expand_prologue): Set current_function_static_stack_size. From-SVN: r164819
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c13
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b277f35..3fb99f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-30 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (sh_expand_prologue): Set
+ current_function_static_stack_size.
+
2010-09-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac: Check for Solaris 8 ld with .hidden support.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1e8b141..1c201bb 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -6860,6 +6860,7 @@ sh_expand_prologue (void)
int d_rounding = 0;
int save_flags = target_flags;
int pretend_args;
+ int stack_usage;
tree sp_switch_attr
= lookup_attribute ("sp_switch", DECL_ATTRIBUTES (current_function_decl));
@@ -6876,6 +6877,7 @@ sh_expand_prologue (void)
output_stack_adjust (-pretend_args
- crtl->args.info.stack_regs * 8,
stack_pointer_rtx, 0, NULL, false);
+ stack_usage = pretend_args + crtl->args.info.stack_regs * 8;
if (TARGET_SHCOMPACT && flag_pic && crtl->args.info.call_cookie)
/* We're going to use the PIC register to load the address of the
@@ -6934,6 +6936,7 @@ sh_expand_prologue (void)
))
break;
push (rn);
+ stack_usage += GET_MODE_SIZE (SImode);
}
}
}
@@ -7006,6 +7009,7 @@ sh_expand_prologue (void)
output_stack_adjust (-(save_size + d_rounding), stack_pointer_rtx,
0, NULL, true);
+ stack_usage += save_size + d_rounding;
sh5_schedule_saves (&live_regs_mask, &schedule, offset_base);
tmp_pnt = schedule.temps;
@@ -7157,7 +7161,10 @@ sh_expand_prologue (void)
gcc_assert (entry->offset == d_rounding);
}
else
- push_regs (&live_regs_mask, current_function_interrupt);
+ {
+ push_regs (&live_regs_mask, current_function_interrupt);
+ stack_usage += d;
+ }
if (flag_pic && df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM))
emit_insn (gen_GOTaddr2picreg ());
@@ -7181,6 +7188,7 @@ sh_expand_prologue (void)
output_stack_adjust (-rounded_frame_size (d) + d_rounding,
stack_pointer_rtx, 0, NULL, true);
+ stack_usage += rounded_frame_size (d) - d_rounding;
if (frame_pointer_needed)
frame_insn (GEN_MOV (hard_frame_pointer_rtx, stack_pointer_rtx));
@@ -7194,6 +7202,9 @@ sh_expand_prologue (void)
"__GCC_shcompact_incoming_args", SFUNC_GOT);
emit_insn (gen_shcompact_incoming_args ());
}
+
+ if (flag_stack_usage)
+ current_function_static_stack_size = stack_usage;
}
void