diff mbox

RFA: RL78: Add -fstack-usage support

Message ID 4F7C5011.4020606@redhat.com
State New
Headers show

Commit Message

Nick Clifton April 4, 2012, 1:43 p.m. UTC
Hi Eric,

 > On 04/04/12 12:24, Eric Botcazou wrote:
> You probably need to adjust gcc.dg/stack-usage-1.c too.
> s/flag_stack_usage/flag_stack_usage_info/

Thanks for the corrections.  Revised patch attached.

OK for mainline/4.7 branch ?

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.

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

	* gcc.dg/stack-usage-1.c (SIZE): Define for the RL78.

Comments

DJ Delorie April 5, 2012, 5:04 p.m. UTC | #1
> OK for mainline/4.7 branch ?

Ok with me
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_info)
+    current_function_static_stack_size = cfun->machine->framesize;
+
   for (i = 0; i < 16; i++)
     if (cfun->machine->need_to_push [i])
       {
Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
--- gcc/testsuite/gcc.dg/stack-usage-1.c	(revision 186130)
+++ gcc/testsuite/gcc.dg/stack-usage-1.c	(working copy)
@@ -58,6 +58,8 @@ 
 #  define SIZE 224
 #elif defined (__epiphany__)
 #  define SIZE (256 - __EPIPHANY_STACK_OFFSET__)
+#elif defined (__RL78__)
+#  define SIZE 254
 #else
 #  define SIZE 256
 #endif