Almost definetly not your fault
Toon Moene
toon@moene.indiv.nluug.nl
Tue Nov 30 23:39:00 GMT 1999
Andreas Jaeger wrote:
>
> >>>>> Kendall S Hunter writes:
>
> > I'm sorry, I've just spend an hour looking for updated information without
> > any luck.
>
> > Ever since upgrading to RedHat 6.0, I have been unable to use the piece of
> > code provided "trapfpe.c" to trap floating point exceptions. Instead, the
> > link responds:
>
> > libtrapfpe.a: In function `trapfpe':
> > libtrapfpe.a(.text+0x9): undefined reference to `__setfpucw'
> > collect2: ld returned 1 exit status
> __setfpucw is an internal symbol of glibc, you can't use it anymore.
>
> I advise to use the functions from <fenv.h>.
Andreas, do you have a good substitute for the following in the g77
manual, i.e. something that's less dependent on specific versions of
glibc (quoting f/g77.texi):
@cindex x86 floating-point
If your program depends on exact IEEE 754 floating-point handling it may
help on some systems---specifically x86 or m68k hardware---to use
the @samp{-ffloat-store} option or to reset the precision flag on the
floating-point unit.
@xref{Optimize Options}.
However, it might be better simply to put the FPU into double precision
mode and not take the performance hit of @samp{-ffloat-store}. On x86
and m68k GNU systems you can do this with a technique similar to that
for turning on floating-point exceptions
(@pxref{Floating-point Exception Handling}).
The control word could be set to double precision by
replacing the @code{__setfpucw} call with one like this:
@smallexample
__setfpucw ((_FPU_DEFAULT & ~_FPU_EXTENDED) | _FPU_DOUBLE);
@end smallexample
(It is not clear whether this has any effect on the operation of the GNU
maths library, but we have no evidence of it causing trouble.)
See: http://egcs.cygnus.com/onlinedocs/g77_19.html#SEC585
Thanks in advance,
--
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html
More information about the Gcc-bugs
mailing list