https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90113

            Bug ID: 90113
           Summary: Useless torture mode for gfortran.dg tests
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhroma at ispras dot ru
  Target Milestone: ---

I’ve recently found that tests, which are placed in gcc/testsuite/gfortran.dg
folder are running in “torture” mode with different optimization options.

While working with PR90001 I’ve looked into sms-2.f90 and forall_10.f90 tests
from gfortran.dg.  I analyzed only compilation time in that PR, but also was
wondered with that these tests were compiled several times with lines like:
sms-2.f90:
“-O0 -O2 -fmodulo-sched”
“-O1 -O2 -fmodulo-sched”
...
“-O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
-finline-functions -O2 -fmodulo-sched”

forall_10.f90
“-O0 -O”
“-O1 -O”
...
“-O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
-finline-functions -O”

I’ve found a discussion when gfortran.dg/dg.exp was added in 2004, and there 
Joseph mentioned “torture” ideas:
https://gcc.gnu.org/ml/gcc-patches/2004-07/msg01131.html
“gcc.c-torture: multiple optimization options, built with -w to disable all
warnings.
gcc.dg: no looping over multiple options, defaults to -ansi -pedantic if
no options given.
gcc.dg/torture: like gcc.dg (so no -w) but loops over multiple options.  
Much of gcc.dg that uses some optimization options belongs in there.”

I’ve started working with gcc a bit later, but I always thought, that same
logic can be applied to other languages.  And now I know that in fortran tests
it is broken since that old time.

Looking into recent commits (which add new fortran tests) shows that people
also wrongly suppose that difference between gfortran.fortran-torture and
gfortran.dg is same as in C language test folders (gcc.c-torture and gcc.dg).

So, a lot of tests in gfortran.dg contain optimization level option, and this
leads to many useless torture runs.  In most torture option lines only
optimization level is set, and an option inside test overrides that level.

Maybe this broken logic should be fixed and we have to disable torture runs in
gfortran.dg and run them like gcc.dg tests?

Reply via email to