public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16198] New: fegetenv() clears exception mask on x86_64
@ 2013-11-20 22:50 fxcoudert at gcc dot gnu.org
  2013-11-20 23:38 ` [Bug math/16198] " joseph at codesourcery dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2013-11-20 22:50 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16198
           Summary: fegetenv() clears exception mask on x86_64
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: fxcoudert at gcc dot gnu.org

Take the following code:

#include <stdio.h>
#include <fenv.h>

int main (void)
{
  fenv_t e;

  printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
  feenableexcept (FE_INVALID);
  printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
  fegetenv (&e);
  printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
  fesetenv (&e);
  printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
}


I expect it to output "0 1 1 1", and it does on i386-linux. But on
x86_64-linux, it outputs "0 1 0 1", showing that the call to fegetenv() clears
the exception mask. I don't see this behavior documented, and I don't think
it's allowed.

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-13 11:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-20 22:50 [Bug math/16198] New: fegetenv() clears exception mask on x86_64 fxcoudert at gcc dot gnu.org
2013-11-20 23:38 ` [Bug math/16198] " joseph at codesourcery dot com
2013-11-20 23:41 ` fxcoudert at gcc dot gnu.org
2013-11-21  0:23 ` joseph at codesourcery dot com
2013-11-21  7:18 ` fxcoudert at gcc dot gnu.org
2014-02-06 18:34 ` [Bug math/16198] [x86_64] " jsm28 at gcc dot gnu.org
2014-03-26 19:00 ` cvs-commit at gcc dot gnu.org
2014-03-26 19:00 ` jsm28 at gcc dot gnu.org
2014-06-13 11:53 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).