[commit, spu] Support -fstack-usage

Ulrich Weigand uweigand@de.ibm.com
Wed Jan 5 13:40:00 GMT 2011


Hello,

this enables support for the new -fstack-usage switch in the SPU back-end.

Tested on spu-elf.
Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* config/spu/spu.c (spu_expand_prologue): Support -fstack-usage.

testsuite/ChangeLog:

	* gcc.dg/stack-usage-1.c (SIZE): Provide proper value for __SPU__.


Index: gcc/testsuite/gcc.dg/stack-usage-1.c
===================================================================
*** gcc/testsuite/gcc.dg/stack-usage-1.c	(revision 168463)
--- gcc/testsuite/gcc.dg/stack-usage-1.c	(working copy)
***************
*** 39,44 ****
--- 39,46 ----
  #  define SIZE 96  /* 256 - 160 bytes for register save area */
  #elif defined (__s390__)
  #  define SIZE 160 /* 256 -  96 bytes for register save area */
+ #elif defined (__SPU__)
+ #  define SIZE 224
  #else
  #  define SIZE 256
  #endif
Index: gcc/config/spu/spu.c
===================================================================
*** gcc/config/spu/spu.c	(revision 168463)
--- gcc/config/spu/spu.c	(working copy)
*************** spu_expand_prologue (void)
*** 2086,2091 ****
--- 2086,2093 ----
  	}
      }
  
+   if (flag_stack_usage)
+     current_function_static_stack_size = total_size;
  }
  
  void
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list