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

--- Comment #14 from Sunil Pandey <skpgkp2 at gmail dot com> ---
(In reply to Richard Biener from comment #7)
> (In reply to Sunil Pandey from comment #4)
> > Actually it is spec cpu 2017 521.wrf benchmark getting this problem while
> > compiling. Compilation taking forever, you can see while compiling file
> > module_first_rk_step_part1.fppized.f90 as a representative.
> 
> Note this file contains a single function which (besides USEing quite a
> number
> of modules...) has only function calls involving a lot of parameters
> effectively forwarding parameters from the function.  Thus
> 
> SUBROUTINE foo (psim, ..., ims, ime, jms, jme)
>     REAL    ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT)         :: psim
>     call sub1 (PSIM=psim, ...)
>     call sub2 (PSIM=psim, ...)
> END SUBROUTINE
> 
> with a _lot_ of arrays being passed through.  A simple testcase like
> 
> SUBROUTINE sub1 (psim, ims, ime, jms, jme)
>     REAL    ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT)         :: psim
> END SUBROUTINE
> SUBROUTINE foo (psim, ims, ime, jms, jme)
>     REAL    ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT)         :: psim
>     call sub1 (psim, ims, ime, jms, jme)
> END SUBROUTINE
> 
> doesn't show any extra loops generated though, so I'm not sure what to
> look after.

It seems very hard to create a small test case which reproduce the long compile
time problem. Unfortunately, I'm not allowed to upload spec source file. Also
it's very big with lots of module dependency. Assuming you have spec 2017
sources,

Here is unmodified command line, which show compile time problem.

Spec build dir: 
===============

/local/skpandey/gccwork/specx5/cpu2017/benchspec/CPU/521.wrf_r/build/build_base_gcc-10.0.0-x86-64.0000

Before the commit in question:
==============================

Take 41 second to compile unmodified file with -O2 -march=skylake

$ time
/local/skpandey/gccwork/gcc_trunk/tools-build/gcc-debug/release.a4ba5c3ec624008e899a8bcb687359db25140c23/usr/gcc-10.0.0-x86-64/bin/gfortran
 -m64 -c -o module_first_rk_step_part1.fppized.o -I. -I./netcdf/include -I./inc
-fno-unsafe-math-optimizations -mfpmath=sse -O2 -march=skylake -funroll-loops
-fconvert=big-endian module_first_rk_step_part1.fppized.f90

real    0m41.295s
user    0m41.031s
sys     0m0.204s

After the commit in question:
=============================

It take about 12 minute with -O2 -march=skylake

$ time
/local/skpandey/gccwork/gcc_trunk/tools-build/gcc-debug/release/usr/gcc-10.0.0-x86-64/bin/gfortran
 -m64 -c -o module_first_rk_step_part1.fppized.o -I. -I./netcdf/include -I./inc
-fno-unsafe-math-optimizations -mfpmath=sse -O2 -march=skylake -funroll-loops
-fconvert=big-endian module_first_rk_step_part1.fppized.f90

real    11m59.498s
user    11m53.304s
sys     0m4.835s


With higher optimization like -O3 or -Ofast, it take even longer and I have to
kill it.

Reply via email to