This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/16198] fegetenv() clears exception mask on x86_64
- From: "fxcoudert at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 20 Nov 2013 23:41:47 +0000
- Subject: [Bug math/16198] fegetenv() clears exception mask on x86_64
- Auto-submitted: auto-generated
- References: <bug-16198-131 at http dot sourceware dot org/bugzilla/>
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.