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]

[gfortran] Speed up testsuite


As discussed before, this patch speeds up our testsuite by not running
the compiler with all of TORTURE_OPTIONS on compile-only testcases.

Timings:
                                  before after
gfortran.fortran-torture/compile     34s    4s
gfortran.dg                        2m29s   52s

Not as big a saving as I would have hoped, but it's something at least.
I decided to check compile testcases with the '-O' option, as the time a
test takes is usually dominated by the startup time for the compiler,
and running optimization exposes more codepaths. Apart from that the
changes are fairly trivial: in fortran-torture.exp I simply replaced the
option list by a list with the single element list {"-O"}, and in
gfortran-dg.exp I replaced the call to gcc-dg-runtest with the body of
gcc-dg-runtest, in which I then replaced the way the argument lists are
setup , so that tests which contain the string "dg-do run" are tested
with the full set of options and all others are only tested with -O.

- Tobi


2004-07-13  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

	* lib/fortran-torture.exp (fortran-torture): Don't test compile
	tests with full	list of options.
	* lib/gfortran-dg.exp (gfortran-dg-runtest): Only test with all
	of TORTURE_OPTIONS if test contains "dg-do run".

Index: lib/fortran-torture.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/fortran-torture.exp,v
retrieving revision 1.3
diff -u -p -r1.3 fortran-torture.exp
--- lib/fortran-torture.exp     9 Jul 2004 10:20:42 -0000       1.3
+++ lib/fortran-torture.exp     13 Jul 2004 23:27:55 -0000
@@ -325,7 +325,7 @@ proc fortran-torture { args } {
     }

     # loop through all the options
-    set option_list $TORTURE_OPTIONS
+    set option_list [list { "-O" } ]
     foreach option $option_list {

        # torture_compile_xfail is set by the .x script (if present)
Index: lib/gfortran-dg.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gfortran-dg.exp,v
retrieving revision 1.2
diff -u -p -r1.2 gfortran-dg.exp
--- lib/gfortran-dg.exp 9 Jul 2004 15:03:17 -0000       1.2
+++ lib/gfortran-dg.exp 13 Jul 2004 23:27:55 -0000
@@ -43,5 +43,30 @@ proc gfortran-dg-prune { system text } {
 # Modified dg-runtest that can cycle through a list of optimization options
 # as c-torture does.
 proc gfortran-dg-runtest { testcases default-extra-flags } {
-    return [gcc-dg-runtest $testcases ${default-extra-flags}]
+    global runtests
+    global TORTURE_OPTIONS
+
+    foreach test $testcases {
+       # If we're only testing specific files and this isn't one of
+       # them, skip it.
+       if ![runtest_file_p $runtests $test] {
+           continue
+        }
+
+       # look if this is dg-do-run test, in which case
+       # we cycle through the option list, otherwise we don't
+       if [expr [search_for $test "dg-do run"]] {
+           set option_list $TORTURE_OPTIONS
+       } else {
+           set option_list [list { -O } ]
+       }
+
+       set nshort [file tail [file dirname $test]]/[file tail $test]
+
+       foreach flags $option_list {
+           verbose "Testing $nshort, $flags" 1
+           dg-test $test $flags ${default-extra-flags}
+       }
+    }
 }


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