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:49:56PM +0200, Daniel Franke wrote:
> On Thursday 19 July 2007 23:42:06 Brooks Moses wrote:
> > Yeah, I thought so at first, but those both have the same exponent range
> > IIRC, and certainly not enough to get up to an erroneous answer of 273
> > instead of 18 before it overflows.
>
> As both, -ffloat-store and the external function (a CONTAINed function doesn't
> work, inlining?) give consistent results, I'd assume that it's the right
> ballpark, at least. It also hints that the usage of PRINT in the first loop
> has the same effect?!
Paul Brook has corrected me. The extra-precision registers _do_ have
enough extra precision that 273 is a reasonable answer for this theory.
Sorry for the confusion, then. :)
So, yeah, -ffloat-store or -mfpmath=sse is the right answer.
- Brooks