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: Optimisation prevents overflow?


At 02:23 PM 7/19/2007, Davide Mancusi wrote:
...and yes, -ffloat-store fixes it. What does it do? I could not find documentation about it.

It should be documented in the main GCC manual. (The GFortran manual only documents the options specific to the Fortran front end, and this is a global GCC option.)


What that option does is guarantee that the results of calculations always go through a memory store, rather than simply being left in registers between operations. I thought that this was an instance of PR323 (see http://gcc.gnu.org/PR323 for details), which that's designed to fix, but on reflection that still shouldn't produce anything nearly as high as 273 for the erroneous answer. So probably what's happening is that this has a side effect of changing whatever optimization is causing the problem.

What version of GFortran are you using, and what platform, again? This does seem like a bug of some sort.

Also: What optimization options are you using? You copied the wrong command line in your original post, and didn't include those. :)

- Brooks


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