This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: different behaviours - same compiler - different platforms
- From: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>
- To: fortran at gcc dot gnu dot org
- Date: 13 Apr 2011 22:03:07 +0100
- Subject: Re: different behaviours - same compiler - different platforms
- References: <31391742.post@talk.nabble.com>
On Apr 13 2011, afylot wrote:
I got a problem with a fortran 77 code running on two different computers
with different architectures (intel pentium 4 and dual core opteron). The
code was compiled with the same compiler gcc 4.1.2. I found two
completely different results at runtime. I find that the problem is
apparently solved by removing 10 double precision variables that were
defined but not actually used. Can it be a memory issue? How can I
prevent this from happening?
Almost always, this is due to an undetected error in your program (e.g.
an array element reference out of bounds) that is causing data corruption.
You are lucky if you get a nice SIGSEGV :-(
The solution is to fix your code. Sorry, but that's reality, and has
been since the beginning of modern computing.
Just occasionally, it's a compiler bug, but even experts are more likely
to have an undetected error in their code.
Regards,
Nick Maclaren.