public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/31023] New: feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa
@ 2023-11-01 19:58 bruno at clisp dot org
  2023-11-01 19:58 ` [Bug math/31023] " bruno at clisp dot org
  2023-11-01 19:58 ` bruno at clisp dot org
  0 siblings, 2 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-11-01 19:58 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 31023
           Summary: feupdateenv does not trigger traps for previously
                    flagged floating-point exceptions on hppa
           Product: glibc
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: bruno at clisp dot org
  Target Milestone: ---

Created attachment 15204
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15204&action=edit
test case foo.c

In ISO C 23 § 7.6.6.4 the standard says:
"The feupdateenv function attempts to save the currently raised floating-point
exceptions in its automatic storage, install the dynamic floating-point
environment represented by the object pointed to by envp, and then raise the
saved floating-point exceptions."

This works on all platforms, but not on hppa. (I'm using Debian 12 GNU/Linux
hppa).

How to reproduce: Compile and run the attached foo.c.
$ gcc -Wall foo.c -lm
$ ./a.out; echo $?

Expected result:
Floating point exception (core dumped)
or
Illegal instruction (core dumped)

Actual result:
0

The bug is in feupdateenv, because when I add a correct definition of
feupdateenv to the program, things work as expected:

$ gcc -Wall foo-corrected.c -lm
$ ./a.out; echo $?
Illegal instruction
132

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

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

* [Bug math/31023] feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa
  2023-11-01 19:58 [Bug math/31023] New: feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa bruno at clisp dot org
@ 2023-11-01 19:58 ` bruno at clisp dot org
  2023-11-01 19:58 ` bruno at clisp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-11-01 19:58 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|                            |hppa-unknown-linux-gnu

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

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

* [Bug math/31023] feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa
  2023-11-01 19:58 [Bug math/31023] New: feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa bruno at clisp dot org
  2023-11-01 19:58 ` [Bug math/31023] " bruno at clisp dot org
@ 2023-11-01 19:58 ` bruno at clisp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-11-01 19:58 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Bruno Haible <bruno at clisp dot org> ---
Created attachment 15205
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15205&action=edit
test case with workaround

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

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

end of thread, other threads:[~2023-11-01 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 19:58 [Bug math/31023] New: feupdateenv does not trigger traps for previously flagged floating-point exceptions on hppa bruno at clisp dot org
2023-11-01 19:58 ` [Bug math/31023] " bruno at clisp dot org
2023-11-01 19:58 ` bruno at clisp dot org

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).