From: Thorsten Ohl <ohl@*RemoveTheStars*hep.tu-darmstadt.de>
Subject: Re: Mysterious data corruption in Fortran with -automatic
Date: 1998/06/05 [thread overview]
Message-ID: <ueemx412rk.fsf@heplix.ikp.physik.tu-darmstadt.de> (raw)
In-Reply-To: 01bd9039$7d242ba0$LocalHost@stupidwin95
"Kevin G. Rhoads" <T_Rhoads@NoSpam.CLASSIC.MSN.COM> writes:
> All of what you've said boils down to >you must be writing buggy
> code< asserted with NO justification, based on what was posted NO
> reasoning or evidence offered in support
Without the original poster supplying complete code (the little
snippet that he posted is alread his interpretation of the bug) we can
do litte more than guessing.
> I fail to see how anyone can reasonable suggest that when code
> compiles cleanly, with neither error NOR WARNING and produces two
> wildly different results depending ONLY on the compiler settings
> that it MUST be bugs in the code, and the compiler is necessarily
> faultless.
Simple example: most people with prior exposure to C are prone to
writing things like
if ((x /= 0) .and. (test_condition_assuming_x_not_0 (x))) then
....
end if
since most compilers don't reorder boolean expressions, this bug will
not be noticed until you hit a compiler (like DEC's) that takes
advantage of Fortran's fredom to reorder booleans. I have had this
(in numerous disguises) more than once.
> Are you just flaming? Or do you have some justification you are not
> sharing with the rest of us?
Careful. Forgetting to SAVE variables is a _very_ common mistake. It
still happens occasionally to me and the response to the -automatic
switch is a smoking gun when a student shows up with this problem
[believe me: almost all do at one point in their career ...]
True anecdote:
A few months back I tested a new fortran compiler on some old code
that worked on IBMs with VM and MVS, on VAXen with VMS, and on more
flavors of UNIX that I can remember. Everywhere the results where
(up to floating point differences) identical.
The new compiler appeared to produce complete garbage and I was
ready to blame the compiler. Then I tried the -static switch (the
opposite of -automatic on this compiler) and the code produced
correct results. Then it took very little time to track down a
forgotten SAVE.
--
Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
http://crunch.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]
next prev parent reply other threads:[~1998-06-05 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 ` Thorsten Ohl
1998-06-04 4:00 ` Kevin G. Rhoads
1998-06-04 4:00 ` Jeffrey J. Potoff
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 ` Thorsten Ohl [this message]
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` William Clodius
1998-06-05 4:00 ` William Clodius
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-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 ` Kevin G. Rhoads
1998-06-05 4:00 ` Harald Anlauf
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 ` 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 ` John Appleyard
1998-06-05 4:00 ` Keith Refson - real email address in signature
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-08 4:00 ` Paul Winalski
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