This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: Almost definetly not your fault


>>>>> 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

 > I've used nm to look at libc-2.1.1, and to the best of my limited knowledge
 > __setfpucw seems to be defined. What's the problem?

glibc-2.1.1 has it's own bug reporting address - please use the
glibcbug script.

__setfpucw is an internal symbol of glibc, you can't use it anymore.

I advise to use the functions from <fenv.h>.

If you've got special needs, you might want to use some assembler
instructions:
/* Macros for accessing the hardware control word.  */
#define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw))
#define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw))

glibc 2.2 will have a better solution for setting individual bits of
the fpu cw.

Andreas
-- 
 Andreas Jaeger   
  SuSE Labs aj@suse.de	
   private aj@arthur.rhein-neckar.de


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