This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Optimisation prevents overflow?
On Thu, Jul 19, 2007 at 11:43:14PM +0200, Davide Mancusi wrote:
> Daniel Franke ha scritto:
> > I'd guess, that's the (in)famous extended precision, 80 vs. 64 bits (iirc).
>
> I'm going from memory here and I might be wrong, but wasn't this
> something that concerned (affected?!) only x86 processors? I'm asking
> because my OP stemmed from an incosistent behaviour of g77 on a
> Sun/SPARC machine and a Linux/x86 machine, which I suspect might be
> related to the minimal example I posted here.
>
> Is there any way to turn off this extended precision in g77 (or gfortran)?
This does only affect x86 processors, as far as I know. And going from
18 to 273 is an unlikely result for your program even with the extra
precision.
The -ffloat-store is the traditional way of turning it off, and amounts
to a sort of overkill but works. Also, reportedly the "-mfpmath=sse"
reportedly works for this, but I haven't tried it.
(To GFortran people: This was discussed in the floating-point math BOF
at the Summit yesterday. Geert Bosch says it works fine; a few people
were slightly dubious.)
- Brooks