This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit, testsuite, spu] Reserve extra stack for compat.exp tests


Hello,

a couple of compat.exp tests were crashing because of stack overflows
on the SPU.  Those tests need --auto-overlay to allow code to fit into
the SPU's local store; with this flag, the linker will automatically
determine how much space to leave free for stack usage.  The method
used by the linker will detect statically allocated stack space, but
cannot take dynamically allocated space into account.

Since some of the tests use local variables with more than default
alignment requirements, those will now be allocated dynamically,
which causes the linker to miss those and under-size the stack.

The patch below adds a --extra-stack-space argument to the linker
command line to reserve some additional space.  This fixes the
test case crashes.

Tested on spu-elf, committed to mainline.

Bye,
Ulrich

ChangeLog:

	* lib/compat.exp (compat-execute): Pass -Wl,--extra-stack-space=8192
	when using auto-overlay support on the SPU.

Index: gcc/testsuite/lib/compat.exp
===================================================================
*** gcc/testsuite/lib/compat.exp	(revision 169143)
--- gcc/testsuite/lib/compat.exp	(working copy)
*************** proc compat-execute { src1 sid use_alt }
*** 288,293 ****
--- 288,294 ----
      # Use automatic overlay support to make them fit.
      if { [check_effective_target_spu_auto_overlay] } {
  	set extra_flags_1 "$extra_flags_1 -Wl,--auto-overlay"
+ 	set extra_flags_1 "$extra_flags_1 -Wl,--extra-stack-space=8192"
  	set extra_flags_1 "$extra_flags_1 -ffunction-sections"
  	set extra_flags_2 "$extra_flags_2 -ffunction-sections"
  	set extra_flags_3 "$extra_flags_3 -ffunction-sections"
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]