Patchwork RFA: MN10300: Add support for -fstack-usage

login
register
mail settings
Submitter Nick Clifton
Date Aug. 6, 2012, 9:48 a.m.
Message ID <873940bbb4.fsf@redhat.com>
Download mbox | patch
Permalink /patch/175306/
State New
Headers show

Comments

Nick Clifton - Aug. 6, 2012, 9:48 a.m.
Hi Jeff, Hi Alex,

  Please may I apply the small patch below to add support for reporting
  stack usage to the MN10300 port ?

Cheers
  Nick

gcc/ChangeLog
2012-08-06  Nick Clifton  <nickc@redhat.com>

	* config/mn10300/mn10300.c (mn10300_expand_prologue): Report
	stack usage if requested.
Jeff Law - Aug. 6, 2012, 3:21 p.m.
On 08/06/2012 03:48 AM, Nick Clifton wrote:
> Hi Jeff, Hi Alex,
>
>    Please may I apply the small patch below to add support for reporting
>    stack usage to the MN10300 port ?
>
> Cheers
>    Nick
>
> gcc/ChangeLog
> 2012-08-06  Nick Clifton  <nickc@redhat.com>
>
> 	* config/mn10300/mn10300.c (mn10300_expand_prologue): Report
> 	stack usage if requested.
This is fine.  Thanks.

jeff

Patch

Index: gcc/config/mn10300/mn10300.c
===================================================================
--- gcc/config/mn10300/mn10300.c	(revision 190157)
+++ gcc/config/mn10300/mn10300.c	(working copy)
@@ -744,6 +744,9 @@ 
 {
   HOST_WIDE_INT size = mn10300_frame_size ();
 
+  if (flag_stack_usage_info)
+    current_function_static_stack_size = size;
+
   /* If we use any of the callee-saved registers, save them now.  */
   mn10300_gen_multiple_store (mn10300_get_live_callee_saved_regs (NULL));