diff mbox

RFA: RL78: Add -fstack-usage support

Message ID 87fwcjztos.fsf@Gift.fritz.box
State New
Headers show

Commit Message

Nick Clifton April 4, 2012, 10:18 a.m. UTC
Hi DJ,

  Please could I apply the patch below to the RL78 port ?  It adds
  support for generating stack use info with the -fstack-usage option.

  Also - may I apply this patch to the 4.7 branch as well please ?

Cheers
  Nick

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

	* config/rl78/rl78.c (rl78_expand_prologue): Set stack use
	information, if requested.

Comments

Eric Botcazou April 4, 2012, 11:24 a.m. UTC | #1
>   Please could I apply the patch below to the RL78 port ?  It adds
>   support for generating stack use info with the -fstack-usage option.

You probably need to adjust gcc.dg/stack-usage-1.c too.

> Index: gcc/config/rl78/rl78.c
> ===================================================================
> --- gcc/config/rl78/rl78.c	(revision 186130)
> +++ gcc/config/rl78/rl78.c	(working copy)
> @@ -827,6 +827,9 @@
>    if (!cfun->machine->computed)
>      rl78_compute_frame_info ();
>
> +  if (flag_stack_usage)
> +    current_function_static_stack_size = cfun->machine->framesize;
> +
>    for (i = 0; i < 16; i++)
>      if (cfun->machine->need_to_push [i])
>        {

s/flag_stack_usage/flag_stack_usage_info/
diff mbox

Patch

Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c	(revision 186130)
+++ gcc/config/rl78/rl78.c	(working copy)
@@ -827,6 +827,9 @@ 
   if (!cfun->machine->computed)
     rl78_compute_frame_info ();
 
+  if (flag_stack_usage)
+    current_function_static_stack_size = cfun->machine->framesize;
+
   for (i = 0; i < 16; i++)
     if (cfun->machine->need_to_push [i])
       {