This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug math/16198] fegetenv() clears exception mask on x86_64


https://sourceware.org/bugzilla/show_bug.cgi?id=16198

--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
(In reply to joseph@codesourcery.com from comment #1)
> Presumably fegetenv needs to call fldenv right after fnstenv just like it 
> does on x86 (and of course there should be a testcase, which can be 
> architecture-independent, added to the testsuite for this bug).

I have found code that uses fldcw, right after fnstenv:

  __asm__ __volatile__ ("fnstenv\t%0" : "=m" (*envp));

  /* fnstenv has the side effect of masking all exceptions, so we need
     to restore the control word after that.  */
  __asm__ __volatile__ ("fldcw\t%0" : : "m" (envp->__control_word));


(I've tried to understand why there are so many occurrences of fegetenv, either
in function or macro forms, in x86/i?86/x86_64-specific files in libc, but I
failed utterly. Thanks for having a look at this.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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