[Committed] S/390: Report static stack size for -fstack-usage

Andreas Krebbel krebbel@linux.vnet.ibm.com
Wed Nov 10 11:57:00 GMT 2010


Hi,

the attached patch sets the static size to be printed when using
-fstack-usage.

This fixes the gcc.dg/stack-usage-1.c testcase.

Committed to mainline

Bye,

-Andreas-


2010-11-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc/config/s390/s390.c (s390_emit_prologue): Report the stack
	size if -fstack-usage is used.

2010-11-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.dg/stack-usage-1.c: Define SIZE for s390 and s390x.

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_emit_prologue (void)
*** 7948,7953 ****
--- 7948,7956 ----
    if (!TARGET_PACKED_STACK)
      next_fpr = cfun_save_high_fprs_p ? 31 : 0;
  
+   if (flag_stack_usage)
+     current_function_static_stack_size = cfun_frame_layout.frame_size;
+ 
    /* Decrement stack pointer.  */
  
    if (cfun_frame_layout.frame_size > 0)
Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
*** gcc/testsuite/gcc.dg/stack-usage-1.c.orig
--- gcc/testsuite/gcc.dg/stack-usage-1.c
***************
*** 35,40 ****
--- 35,44 ----
  #  define SIZE 240
  #elif defined (__AVR__)
  #  define SIZE 254
+ #elif defined (__s390x__)
+ #  define SIZE 96  /* 256 - 160 bytes for register save area */
+ #elif defined (__s390__)
+ #  define SIZE 160 /* 256 -  96 bytes for register save area */
  #else
  #  define SIZE 256
  #endif



More information about the Gcc-patches mailing list