[patch, testsuite, spu, fortran] Enable automatic overlay support
Ulrich Weigand
uweigand@de.ibm.com
Thu Apr 16 12:41:00 GMT 2009
Hello,
many of the Fortran test cases are too big for the SPU local store.
The following patch addresses errors caused by this issue:
- It attempts to build all Fortran test cases using the GNU linker's
automatic overlay support. This fixes a large number of cases
that failed because text size exceeded local store.
- It fixes a test in gcc-dg-prune, and adds a corresponding test in
${tool}_check_unsupported_p, to check for linker errors indicating
link failures due to exceeding local store and mark the resulting
tests as unsupported. This catches tests that don't work even with
automatic overlay support, typically because their data section is
too big.
- There is just one single remaining test case that fails not at link
time, but at run-time due to memory allocation failure. I've simply
skipped that test explicitly.
With those changes, I'm seeing no more FAILs due to memory problems.
Tested on spu-elf.
OK for mainline?
Bye,
Ulrich
ChangeLog:
* lib/gcc-dg.exp (gcc-dg-prune): Make linker message check
less strict so it also works with auto-overlay support.
* lib/gcc-defs.exp (${tool}_check_unsupported_p): Add check
for "exceeds local store" linker errors on the SPU.
* lib/gfortran.exp: Include target-supports.exp.
(gfortran_init): On SPU targets where automatic overlay support
is available, use it to build all Fortran test cases.
* gfortran.dg/pr20257.f90: Skip on spu-*-* targets.
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
*** gcc/testsuite/lib/gcc-dg.exp (revision 144779)
--- gcc/testsuite/lib/gcc-dg.exp (working copy)
*************** proc gcc-dg-prune { system text } {
*** 186,192 ****
# Likewise, if we see ".text exceeds local store range" or
# similar.
if {[string match "spu-*" $system] && \
! [string match "*exceeds local store range*" $text]} {
# The format here is important. See dg.exp.
return "::unsupported::memory full"
}
--- 186,192 ----
# Likewise, if we see ".text exceeds local store range" or
# similar.
if {[string match "spu-*" $system] && \
! [string match "*exceeds local store*" $text]} {
# The format here is important. See dg.exp.
return "::unsupported::memory full"
}
Index: gcc/testsuite/lib/gcc-defs.exp
===================================================================
*** gcc/testsuite/lib/gcc-defs.exp (revision 144779)
--- gcc/testsuite/lib/gcc-defs.exp (working copy)
*************** proc ${tool}_check_unsupported_p { outpu
*** 150,155 ****
--- 150,159 ----
if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
return "memory full"
}
+ if {[istarget spu-*-*] && \
+ [string match "*exceeds local store*" $output]} {
+ return "memory full"
+ }
return ""
}
Index: gcc/testsuite/lib/gfortran.exp
===================================================================
*** gcc/testsuite/lib/gfortran.exp (revision 144779)
--- gcc/testsuite/lib/gfortran.exp (working copy)
*************** load_lib prune.exp
*** 27,32 ****
--- 27,33 ----
load_lib gcc-defs.exp
load_lib timeout.exp
load_lib target-libpath.exp
+ load_lib target-supports.exp
#
# GFORTRAN_UNDER_TEST is the compiler under test.
*************** proc gfortran_init { args } {
*** 177,182 ****
--- 178,190 ----
lappend ALWAYS_GFORTRANFLAGS "additional_flags=$TOOL_OPTIONS"
}
+ # On the SPU, most of the fortran test cases exceed local store size.
+ # Use automatic overlay support to make them fit.
+ if { [check_effective_target_spu_auto_overlay] } {
+ lappend ALWAYS_GFORTRANFLAGS "ldflags=-Wl,--auto-overlay"
+ lappend ALWAYS_GFORTRANFLAGS "ldflags=-Wl,--reserved-space=131072"
+ }
+
verbose -log "ALWAYS_GFORTRANFLAGS set to $ALWAYS_GFORTRANFLAGS"
verbose "gfortran is initialized" 3
Index: gcc/testsuite/gfortran.dg/pr20257.f90
===================================================================
*** gcc/testsuite/gfortran.dg/pr20257.f90 (revision 144779)
--- gcc/testsuite/gfortran.dg/pr20257.f90 (working copy)
***************
*** 1,4 ****
--- 1,5 ----
! { dg-do run { target fd_truncate } }
+ ! { dg-skip-if "Too big for local store" { spu-*-* } { "*" } { "" } }
integer,parameter :: n = 10000
real(8) array(10000)
--
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