This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Recalculate Fortran torture options for each target board
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org, janis187 at us dot ibm dot com
- Date: Sun, 25 May 2008 12:57:08 +0100
- Subject: Recalculate Fortran torture options for each target board
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:mail-followup-to:cc:subject:date:message-id:user-agent:mime-version:content-type; bh=kZBtkpeu8WVfLp83LZWQUQ+qEzXlqrxLz6eVZisrKkk=; b=t/DDbo8jPcZ5XuhlTCE/onJBvYLw6V9R8gJPIzwjBtywf1jftC3SQ9bfuuFNbnNQ98lH/CU/5R3I5XpQhtLYWSGOnd8x3IlBISmfOIRARIQpOwwo+ZzsPhIqtMtSu6s8cLswUC5Cs7HvuBsWVWideyODsbTtqeaFj+c9gkKr0Fs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:mail-followup-to:cc:subject:date:message-id:user-agent:mime-version:content-type; b=KdmycLoIWXrLqVGHl51Wouhqlng6j3NuuMxdiqIITIMfdLr4+Oo0DgzuHamZS7dF+HqkwCQzY4vT2IUbw6GLzgwBys3eorRxi97LMg6B6eWHg97aAXpfZtTT5RRK4f0dPNFgpce2XqCPYFU/FMXheTSofxQRFkyPsPghWS4a+m8=
The recent (and very welcome!) clean-up of the torture options means
that we now set up FOO_TORTURE_OPTIONS once, when lib/foo-torture.exp
is first loaded. load_lib does not reload libraries for each target
board.
This is fine for most languages, but not for Fortran, whose default
torture options depend on the target's vector capabilities.
I do mips64*-linux-gnu test runs in the order: -mabi=n32, -mab=32
and -mabi=64, where -mabi=32 has no vectorisation capability
but -mabi=n32 and -mabi=64 do (for some processors at least).
The patch below defines a new function to return a list of
Fortran options for the current target. I can do the same
for other languages if you like.
We currently put the vectorisation options at the end of the list.
On targets with limited vectorisation capabilities, I image the
-O2 executable will often be the same as the "-O2 -tree-vectorize" one.
The framework already tests to see whether the next exectuable is the
same as the last, so we might save time by putting the two options next
to each other in the list. I can't say for certain that we will though,
and I don't have time to find out, so I've left things be for now.
Tested on mips64el-linux-gnu, where it fixes many -mabi=32 failures.
-mabi=n32 and -mabi=64 continue to do the expected vectorisation tests.
OK to install?
Richard
gcc/testsuite/
* lib/fortran-torture.exp (get-fortran-torture-options):
New function, replacing old FORTRAN_TORTURE_OPTIONS code.
* gfortran.fortran-torture/compile/compile.exp: Use
[get-fortran-torture-options] instead of $FORTRAN_TORTURE_OPTIONS.
* gfortran.fortran-torture/execute/execute.exp: Likewise.
Index: gcc/testsuite/lib/fortran-torture.exp
===================================================================
--- gcc/testsuite/lib/fortran-torture.exp 2008-05-25 11:13:29.000000000 +0100
+++ gcc/testsuite/lib/fortran-torture.exp 2008-05-25 12:53:15.000000000 +0100
@@ -22,12 +22,16 @@
load_lib target-supports.exp
+# Return the list of options to use for fortran torture tests.
# The default option list can be overridden by
# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
+proc get-fortran-torture-options { } {
+ global TORTURE_OPTIONS
+
+ if [info exists TORTURE_OPTIONS] {
+ return $TORTURE_OPTIONS
+ }
-if [info exists TORTURE_OPTIONS] {
- set FORTRAN_TORTURE_OPTIONS $TORTURE_OPTIONS
-} else {
# determine if host supports vectorization, and the necessary set
# of options, based on code from testsuite/vect/vect.exp
@@ -61,17 +65,22 @@ if [info exists TORTURE_OPTIONS] {
set test_tree_vectorize 0
}
- set FORTRAN_TORTURE_OPTIONS [list \
- { -O0 } { -O1 } { -O2 } \
+ set options {}
+
+ lappend options \
+ { -O0 } \
+ { -O1 } \
+ { -O2 } \
{ -O2 -fomit-frame-pointer -finline-functions } \
{ -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \
{ -O2 -fbounds-check } \
{ -O3 -g } \
- { -Os }]
-
+ { -Os }
if { $test_tree_vectorize } {
- lappend FORTRAN_TORTURE_OPTIONS $vectorizer_options
+ lappend options $vectorizer_options
}
+
+ return $options
}
Index: gcc/testsuite/gfortran.fortran-torture/compile/compile.exp
===================================================================
--- gcc/testsuite/gfortran.fortran-torture/compile/compile.exp 2008-05-25 11:13:29.000000000 +0100
+++ gcc/testsuite/gfortran.fortran-torture/compile/compile.exp 2008-05-25 12:36:44.000000000 +0100
@@ -26,7 +26,7 @@ load_lib fortran-torture.exp
load_lib torture-options.exp
torture-init
-set-torture-options $FORTRAN_TORTURE_OPTIONS
+set-torture-options [get-fortran-torture-options]
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f]] {
# If we're only testing specific files and this isn't one of them, skip it.
Index: gcc/testsuite/gfortran.fortran-torture/execute/execute.exp
===================================================================
--- gcc/testsuite/gfortran.fortran-torture/execute/execute.exp 2008-05-25 11:13:29.000000000 +0100
+++ gcc/testsuite/gfortran.fortran-torture/execute/execute.exp 2008-05-25 12:36:44.000000000 +0100
@@ -30,7 +30,7 @@ load_lib fortran-torture.exp
load_lib torture-options.exp
torture-init
-set-torture-options $FORTRAN_TORTURE_OPTIONS
+set-torture-options [get-fortran-torture-options]
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f]] {
# If we're only testing specific files and this isn't one of them, skip it.