This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/16449] S/390 Missing exceptions with llrint
- From: "joseph at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 28 Jan 2014 17:35:28 +0000
- Subject: [Bug math/16449] S/390 Missing exceptions with llrint
- Auto-submitted: auto-generated
- References: <bug-16449-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=16449
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Tue, 28 Jan 2014, stli at linux dot vnet.ibm.com wrote:
> the cast from float to long long is handled by a call to libgcc __fixsfdi
> function. This function in (libgcc/config/s390/32) does not raise the INVALID
> exception.
> According to c99 standard the cast is a conversion from float to integer and
> "If the value of the integral part cannot be represented by the integer type,
> the behavior is undefined."
> Is it correct to rely on the simple cast in glibc?
Annex F changes this from undefined to unspecified value plus INVALID
exception (F.4 in C99).
There may well be a case for working around GCC deficiencies in this area
in glibc (conditional on architecture and GCC version needing it) - such
problems apply to several architectures, with the details of what needs
fixing varying from architecture to architecture - but I'd also encourage
reporting libgcc bugs found, and fixing them if possible.
(Properly supporting Annex F in GCC is a large amount of work - but I'd
like to see it done, and indeed the more recent under-development C
bindings for IEEE 754-2008. This particular issue is one of the bits that
could be addressed by a reasonably small self-contained patch.)
--
You are receiving this mail because:
You are on the CC list for the bug.