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/16209] feenableexcept should clear stalled exception flags


http://sourceware.org/bugzilla/show_bug.cgi?id=16209

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
The documented semantics of feenableexcept don't include clearing any 
raised exception flags; I think fetestexcept (FE_ALL_EXCEPT) should return 
the same value before and after a call to feenableexcept, on all 
architectures.  I'm not aware of any architectures clearing exceptions as 
you suggest.

The peculiarities of x86 regarding trapping exceptions may mean use of 
feenableexcept is inherently problematic regarding trapping when things 
shouldn't trap, such as for exceptions already raised when feenableexcept 
is called.  It's also the case that exceptions set by fesetenv or 
fesetexceptflag should not result in traps (but my understanding is that 
fldenv will result in traps at the next floating-point instruction if the 
loaded environment had raised exceptions and trapping enabled for those 
exceptions, contrary to the intent of the standard).

I would guess that any ISO C bindings for alternate exception handling (to 
appear in TS 18661 part 5) would probably not be based around SIGFPE, and 
these x86 processor limitations might limit the extent to which SIGFPE and 
enabling exception trapping at the processor level could be used to 
implement such bindings on x86.  (But I don't know if anyone will 
implement anything much of the TS 18661 bindings to IEEE 754-2008 in GCC 
and glibc, and part 5 - supplemental attributes - would likely be the most 
troublesome part to implement.)

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