Patchwork Commit: XStormy16: Add support for -fstack-usage

login
register
mail settings
Submitter Nick Clifton
Date July 31, 2012, 11:42 a.m.
Message ID <87ipd4uph1.fsf@redhat.com>
Download mbox | patch
Permalink /patch/174255/
State New
Headers show

Comments

Nick Clifton - July 31, 2012, 11:42 a.m.
Hi Guys,

  I am checking in the patch below to add support for reporting stack
  usage by the XStormy16 backend.

Cheers
  Nick

gcc/ChangeLog

Patch

Index: gcc/ChangeLog
2012-07-31  Nick Clifton  <nickc@redhat.com>
 
	* config/stormy16/stormy16.c (xstormy16_expand_prologue): Add
	support for reporting stack usage.

testsuite/ChangeLog
2012-07-31  Nick Clifton  <nickc@redhat.com>
 
	* gcc.dg/stack-usage-1.c (SIZE): Define for FRV,
	and for XStormy16.

Index: gcc/config/stormy16/stormy16.c
===================================================================
--- gcc/config/stormy16/stormy16.c	(revision 190007)
+++ gcc/config/stormy16/stormy16.c	(working copy)
@@ -1035,6 +1035,9 @@ 
   if (layout.locals_size >= 32768)
     error ("local variable memory requirements exceed capacity");
 
+  if (flag_stack_usage_info)
+    current_function_static_stack_size = layout.frame_size;
+
   /* Save the argument registers if necessary.  */
   if (layout.stdarg_save_size)
     for (regno = FIRST_ARGUMENT_REGISTER;
Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
--- gcc/testsuite/gcc.dg/stack-usage-1.c	(revision 190007)
+++ gcc/testsuite/gcc.dg/stack-usage-1.c	(working copy)
@@ -64,6 +64,8 @@ 
 #  define SIZE 252
 #elif defined (__frv__)
 #  define SIZE 248
+#elif defined (xstormy16)
+#  define SIZE 254
 #else
 #  define SIZE 256
 #endif