public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16449] New: S/390 Missing exceptions with llrint
@ 2014-01-14 14:31 krebbel1 at de dot ibm.com
  2014-01-14 14:34 ` [Bug math/16449] " krebbel1 at de dot ibm.com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-14 14:31 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16449
           Summary: S/390 Missing exceptions with llrint
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: krebbel1 at de dot ibm.com

gcc version 4.9.0 20140109 (experimental) [trunk revision 206459] (GCC)

31 bit zarch

glibc testcase test-float:
testing float (without inline functions)
Failure: llrint (inf): Exception "Invalid operation" not set
Failure: llrint (-inf): Exception "Invalid operation" not set
Failure: llrint (qNaN): Exception "Invalid operation" not set
Failure: llrint_tonearest (inf): Exception "Invalid operation" not set
Failure: llrint_tonearest (-inf): Exception "Invalid operation" not set
Failure: llrint_tonearest (qNaN): Exception "Invalid operation" not set
Failure: llrint_towardzero (inf): Exception "Invalid operation" not set
Failure: llrint_towardzero (-inf): Exception "Invalid operation" not set
Failure: llrint_towardzero (qNaN): Exception "Invalid operation" not set
Failure: llrint_downward (inf): Exception "Invalid operation" not set
Failure: llrint_downward (-inf): Exception "Invalid operation" not set
Failure: llrint_downward (qNaN): Exception "Invalid operation" not set
Failure: llrint_upward (inf): Exception "Invalid operation" not set
Failure: llrint_upward (-inf): Exception "Invalid operation" not set
Failure: llrint_upward (qNaN): Exception "Invalid operation" not set
Failure: llround (inf): Exception "Invalid operation" not set
Failure: llround (-inf): Exception "Invalid operation" not set
Failure: llround (qNaN): Exception "Invalid operation" not set

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


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

* [Bug math/16449] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
@ 2014-01-14 14:34 ` krebbel1 at de dot ibm.com
  2014-01-14 16:10 ` joseph at codesourcery dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-14 14:34 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Krebbel <krebbel1 at de dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |s390-ibm-linux
               Host|                            |s390-ibm-linux
              Build|                            |s390-ibm-linux

--- Comment #1 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
Same happens with double and ldouble

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


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

* [Bug math/16449] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
  2014-01-14 14:34 ` [Bug math/16449] " krebbel1 at de dot ibm.com
@ 2014-01-14 16:10 ` joseph at codesourcery dot com
  2014-01-28  9:52 ` stli at linux dot vnet.ibm.com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2014-01-14 16:10 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Likely to be a bug in the s390-specific libgcc functions 
(libgcc/config/s390/32), since llrint handles out-of-range values by a 
simple cast, which is supposed to raise INVALID.

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


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

* [Bug math/16449] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
  2014-01-14 14:34 ` [Bug math/16449] " krebbel1 at de dot ibm.com
  2014-01-14 16:10 ` joseph at codesourcery dot com
@ 2014-01-28  9:52 ` stli at linux dot vnet.ibm.com
  2014-01-28 17:35 ` joseph at codesourcery dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: stli at linux dot vnet.ibm.com @ 2014-01-28  9:52 UTC (permalink / raw)
  To: glibc-bugs

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

stli at linux dot vnet.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stli at linux dot vnet.ibm.com

--- Comment #3 from stli at linux dot vnet.ibm.com ---
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?

In case of lrint, the cast to long is done via hardware instruction, which sets
the INVALID flag. The same happens on 64 bit zarch.

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


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

* [Bug math/16449] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
                   ` (2 preceding siblings ...)
  2014-01-28  9:52 ` stli at linux dot vnet.ibm.com
@ 2014-01-28 17:35 ` joseph at codesourcery dot com
  2014-02-06 18:40 ` [Bug math/16449] [s390] " jsm28 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2014-01-28 17:35 UTC (permalink / raw)
  To: glibc-bugs

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.


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

* [Bug math/16449] [s390] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
                   ` (3 preceding siblings ...)
  2014-01-28 17:35 ` joseph at codesourcery dot com
@ 2014-02-06 18:40 ` jsm28 at gcc dot gnu.org
  2014-02-11 14:15 ` krebbel1 at de dot ibm.com
  2014-06-13  8:57 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-06 18:40 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|S/390 Missing exceptions    |[s390] S/390 Missing
                   |with llrint                 |exceptions with llrint

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


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

* [Bug math/16449] [s390] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
                   ` (4 preceding siblings ...)
  2014-02-06 18:40 ` [Bug math/16449] [s390] " jsm28 at gcc dot gnu.org
@ 2014-02-11 14:15 ` krebbel1 at de dot ibm.com
  2014-06-13  8:57 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-02-11 14:15 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Krebbel <krebbel1 at de dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
Fixed in GCC with:
http://gcc.gnu.org/ml/gcc-patches/2014-02/msg00399.html

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


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

* [Bug math/16449] [s390] S/390 Missing exceptions with llrint
  2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
                   ` (5 preceding siblings ...)
  2014-02-11 14:15 ` krebbel1 at de dot ibm.com
@ 2014-06-13  8:57 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  8:57 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 14:31 [Bug math/16449] New: S/390 Missing exceptions with llrint krebbel1 at de dot ibm.com
2014-01-14 14:34 ` [Bug math/16449] " krebbel1 at de dot ibm.com
2014-01-14 16:10 ` joseph at codesourcery dot com
2014-01-28  9:52 ` stli at linux dot vnet.ibm.com
2014-01-28 17:35 ` joseph at codesourcery dot com
2014-02-06 18:40 ` [Bug math/16449] [s390] " jsm28 at gcc dot gnu.org
2014-02-11 14:15 ` krebbel1 at de dot ibm.com
2014-06-13  8:57 ` 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).