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

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

Comments

Nick Clifton - July 31, 2012, 9:23 a.m.
Hi Guys,

  I am applying the patch below to add support for the -fstack-usage
  option to the FRV backend.

Cheers
  Nick

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

	* config/frv/frv.c (frv_expand_prologue): Report stack usage.

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

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

Patch

Index: gcc/config/frv/frv.c
===================================================================
--- gcc/config/frv/frv.c	(revision 190002)
+++ gcc/config/frv/frv.c	(working copy)
@@ -1761,6 +1761,9 @@ 
   if (TARGET_DEBUG_STACK)
     frv_debug_stack (info);
 
+  if (flag_stack_usage_info)
+    current_function_static_stack_size = info->total_size;
+
   if (info->total_size == 0)
     return;
 
Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
--- gcc/testsuite/gcc.dg/stack-usage-1.c	(revision 189996)
+++ gcc/testsuite/gcc.dg/stack-usage-1.c	(working copy)
@@ -62,6 +62,8 @@ 
 #  define SIZE 254
 #elif defined (__sh__)
 #  define SIZE 252
+#elif defined (__frv__)
+#  define SIZE 248
 #else
 #  define SIZE 256
 #endif