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: secnds.f / secnds-1.f failures


Brooks Moses wrote:
At 10:53 AM 4/27/2007, Steve Ellcey wrote:
I have taken a look at the sporadic secnds.f / secnds-1.f failures
and I have a theory about what the problem is.

In the libgfortran function secnds we have C code containing:

  temp1 = 3600.0 * (GFC_REAL_4)values[4] +
            60.0 * (GFC_REAL_4)values[5] +
                   (GFC_REAL_4)values[6] +
           0.001 * (GFC_REAL_4)values[7];
[...]
We can change the library to do things in single precision or change
the test to do things in double precision and I think that will fix
the test failures.  Any preference on which way to go?

Aha! Yes, that sounds like the sort of thing I'd expect to be causing this problem. Thanks for tracking it down.


I think it probably makes more sense to leave the library code as double-precision, and change the testcase to match.

The difference in results is fairly minimal, but we do have experimental evidence that the different precisions _do_ occasionally get different results, and this function isn't ever likely to be used in a place where speed is of critical importance, so I think there's no good reason to change it to single precision.

In seconds.f when I define dat1 and dat2 as real*8 I no longer get the random failures. Would you like me to do that patch or does someone else want to.

Jerry


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