This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: fortran optimization errors


Dear Jerry and Steve,

  The linux compiler is f90.  I don't think the code is numerically
unstable because I can run it on my mac and compile it with gfortran
and the numerical output is the same no matter what the optimization
tag is.  One odd thing I found with the mac compiler is that when I
would run my code, there would be a segmentation fault when compiled
with -O3, though a simple print statement would fix this, and when I
compiled with out an optimization tag, there would be no segmentation
fault.  This wasn't as alarming to me as the different numerical
output from the linux compiler.  The numerical difference was about
0.1% which is much larger than computational noise which is on the
order of 10^-8.  I can give you more information about the specific
compiler tomorrow when I am at my linux box.

Best Regards, Sebastian

On 6/21/07, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
On Thu, Jun 21, 2007 at 07:32:59PM -0700, Sebastian Sandersius wrote:
>
>     I have found errors in your fortran 95 compiler for linux.  I get
> different numerical output when I compile my program with -O3 then if
> I compile with -g - this shouldn't happed.
>

Clearly, you have an unstable numerical algorithm.
Try adding -ffloat-store to your options.

--
Steve



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