From: "Kevin G. Rhoads" <T_Rhoads@NoSpam.CLASSIC.MSN.COM>
Subject: Re: Mysterious data corruption in Fortran with -automatic
Date: 1998/06/04 [thread overview]
Message-ID: <01bd9013$76f09aa0$6f242499@stupidwin95> (raw)
In-Reply-To: wxsollf8zz.fsf@earth.ox.ac.uk
Keith - first, thanks so very much for MOLDY.
Re data corruption -- I believe the key is later in your
post where you say:
"I should mention that this is compiled with "-g -O2 -automatic" -- the
problem goes away at lower optimization levels."
This really sounds like an optimizer bug.
"More mysteriously exactly the same behaviour is observed
when the code is compiled with f90 instead of f77" not
mysterious if they are from the same vendor, in which case
they likely share the same back-end, where all the low level
optimizations are performed.
I have found that on non-trivial code (anything with more than
a few thousand lines), whether it be C or Fortran, that you
are fairly likely to hit some optimizer bug. Numerical computations
tend to be the most likely to trigger optimizer bugs (just my personal
experience, not from any studies).
I have made it a rule for some years now to compile EVERYTHING
with optimizations off as well as on and compare the results of
standard test runs. This last year I have been bumping into a new
optimizer bug roughly once every other month. (Of course, I have
been running the code through three different vendor's Fortran
compilers and six different vendor's C compilers.)
Now most of my coding these days is on x86/Wintel platforms,
and if you are using workstations I expect the compilers are
much more solid. But, even so, there will be optimizer bugs.
If it is an optimizer bug, the only long-term fix is getting
a corrected compiler from the vendor. In the short-term,
since you've found that putting in debugging writes clears
the problem up, may I humbly suggest that opening a NULL
device for output and leaving those WRITEs in, but directed to
NULL, may be a useable work-around (with, of course, suitably
scathing comments about the sloppiness of the compiler vendor's
coders and Q/A testing . . . ;-) ) Alternatively turn off some
of the optimizations for the module in question.
--
Kevin G. Rhoads, Ph.D.
T_Rhoads@NO_SPAM.Classic.MSN.COM
KRhoads@NO_SPAM.CmpNetMail.com
next prev parent reply other threads:[~1998-06-04 4:00 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-04 4:00 Mysterious data corruption in Fortran with -automatic Keith Refson - real email address in signature
1998-06-04 4:00 ` Kevin G. Rhoads [this message]
1998-06-04 4:00 ` Jeffrey J. Potoff
1998-06-04 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Ian Chivers
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Ian Pattie
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-06 4:00 ` Rob Komar
1998-06-05 4:00 ` Thorsten Ohl
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` William Clodius
1998-06-05 4:00 ` William Clodius
1998-06-04 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Catherine Rees Lay
1998-06-04 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-05 4:00 ` Keith Refson - real email address in signature
1998-06-05 4:00 ` Robert O'Dowd
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` John Appleyard
1998-06-05 4:00 ` Keith Refson - real email address in signature
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Robert O'Dowd
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Stuart Brook
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-05 4:00 ` Harald Anlauf
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-08 4:00 ` Paul Winalski
1998-06-04 4:00 ` Stuart Brook
1998-06-04 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Stuart Brook
1998-06-05 4:00 ` Toon Moene
1998-06-04 4:00 ` Thorsten Ohl
1998-06-06 4:00 ` SUMMARY: Code errors which can masquerade as compiler bugs " Kevin G. Rhoads
1998-06-11 4:00 ` Ron Sverdlove x2517
1998-06-08 4:00 ` Steve Lionel
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox