I am using the 4.5.0 20100225 snapshot with macports on snow leopard.

I have a large legacy fortran codebase that uses both -finit-local-zero and
-fno-automatic together.  The code was not working under gcc 4.4.3. I found
that bug #41860 fixed this problem and had been checked into the trunk.  So, I
tried the head version and I found that my code was now working.  However there
were a few simple routines that were taking ~.5hr-1hr to compile and bringing
my macbook pro to an almost unusable point during the compilation. 

I determined the problem was when there were large two dimensional arrays and
both of the options were used together. I managed to cut this down to a very
small test case.  With either option missing this compiles immediately.  Use
them together it takes about 1.5 minutes:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      subroutine testproblem
C     Use: gfortran -fno-automatic -finit-local-zero -c gfortran-45.F
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

      integer nsub_sta(11146, 2000), nsub_sto(11146, 2000)

      write (*,*) nsub_sta(1,1)
      write (*,*) nsub_sto(1,1)

      return
      end

Here is the version information for my compiler:

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin10/4.5.0/lto-wrapper
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.5-20100225/configure --prefix=/opt/local
--build=x86_64-apple-darwin10 --libdir=/opt/local/lib/gcc45
--includedir=/opt/local/include/gcc45 --infodir=/opt/local/share/info
--mandir=/opt/local/share/man --with-local-prefix=/opt/local --with-system-zlib
--disable-nls --program-suffix=-mp-4.5
--with-gxx-include-dir=/opt/local/include/gcc45/c++/ --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc==/opt/local --enable-stage1-checking
--enable-languages=c,fortran
Thread model: posix
gcc version 4.5.0 20100225 (experimental) (GCC)


-- 
           Summary: -finit-local-zero and -fno-automatic used together with
                    large 2-dim variables take too long to compile
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris dot walter at duke dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43205

Reply via email to