1.5.12: FPU affected by gethostname call
Thu Feb 24 20:49:00 GMT 2005
Okay, sorry: the abs() function was defined as a template in the original code
for historical reasons:
number abs(number) ... and so forth
Changing to std::fabs() doesn't change anything in the behavior, however.
At least now I know it's probably AMD FPU related.
> > Long doubles are 12 byte = 96 bit = sizeof(long double). No matter
> > stored in memory or in registers, they should have that length, no?
> Oh, that does turn out to be a recent change to gcc. Hmm.
> Then again, I can't reproduce the problem here. Maybe that's the AMD
> Intel difference you were wondering about. I've got a P4; same OS
> as you though, XpSp1. It makes no difference if I have the call to
> gethostname or not, and it makes no difference if I compile with or
> > In the original code, tolerance is set to 1e-19 instead of 5e-16 if
> > doubles are available. In this case, the code calling gethostname()
> > into an infinite loop.
> That code is seriously buggy, isn't it?
> const long double tolerance = 5e-16;
> long double p1, p2, p3;
> [details omitted]
> while (abs(p1/pp) > tolerance);
> <koff> I really think that ought to have been *f*abs, should it not?
> Heh. Why do people always think they can just ignore compiler
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin