This is the mail archive of the gcc-help@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]

Fortran weirdness


Hi!

We're in the process of migrating a few different platforms to Linux, one of
these platforms is Solaris, where we're currently running:

f77: WorkShop Compilers 5.0 98/12/15 FORTRAN 77 5.0

to compile 72k+112k lines of "legacy" (third-party) fortran code into object
files that are linked with in-house C code.  These binaries run fine.


On Linux, using g77 0.5.25 20010319 (prerelease) or 0.5.26 20020220 (release)
and gcc 2.95.4 20011002 (Debian prerelase), they don't.

Compilation goes fairly well, g77 just tells us this for one of the files:
--8<--
         DATA OPTLIS /SIZEOP * ENDLLI/
                      ^
Initialization of large (322350-unit) aggregate area `optlis' at (^)
currently very slow and takes lots of memory during g77 compile -- to be
improved in 0.6
-->8--
but this seems to be a matter of compilation time rather than actual errors
during compilation.

Unfortunately, when the program is run, we get into trouble.  The Fortran
code reads a couple of flatfile databases, using formatted READ()s in all
the right places, and our g77 compiled code on Linux ends up with NAN in a
certain position in an array where f77 compiled code on Solaris has 1006.83.

There are a bunch of other, just fine, values before our missing one that
very likely also originate from the textfile databases.

Any ideas as to why the g77 compiled code ends up with bad data?  Any more
information I can provide?

I've tried adding -fno-automatic -finit-local-zero -Wpedantic -Wsurprising
but all this gives is warnings about precedence for immediate negative
numbers and the gobs of unused variables in the code.  No difference at
runtime.

On both Linux and Solaris, we're using the Fortran compiler for linking.

Thanks in advance for any insight!


//Peter


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