From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8942E3858CDA; Tue, 24 Oct 2023 18:19:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8942E3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1698171596; bh=Ut+SQX+sdzhpP/4VBk2kFVxPN00thkWLIfFEGXLZxdE=; h=From:To:Subject:Date:From; b=kNntJfL8dPGut6HkLN8wALcEwTORXZiJnbXrIB6DF9BBKM3UQFqftljXvS78q+uUA jpgE2TKh9X4+kp1uOegqthWKn1r0qZCIUYDg+H/z6lNfWqjc8pXJDmmgFinQsJ+dGr ZfiexUvfI8X8S9TsBO1XQvKyXllLNOuS8QAbJpWI= From: "bruno at clisp dot org" To: glibc-bugs@sourceware.org Subject: [Bug math/30998] New: fesetexceptflag clears too many floating-point exception flags on alpha Date: Tue, 24 Oct 2023 18:19:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: 2.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bruno at clisp dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30998 Bug ID: 30998 Summary: fesetexceptflag clears too many floating-point exception flags on alpha Product: glibc Version: 2.36 Status: UNCONFIRMED Severity: normal Priority: P2 Component: math Assignee: unassigned at sourceware dot org Reporter: bruno at clisp dot org Target Milestone: --- Created attachment 15196 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15196&action=3Ded= it test case foo.c On Linux/alpha, the function fesetexceptflag() clears some exception flags = that are outside the EXCEPTS argument. This violates ISO C 23 =C2=A7 7.6.4.5, wh= ich says: "The fesetexceptflag function attempts to set the floating-point status f= lags indicated by the argument excepts to the states stored in the object pointe= d to by flagp." How to reproduce: Compile and run the attached program. $ gcc -Wall foo.c -lm $ ./a.out Expected: It terminates with exit code 0. Actual: a.out: foo.c:58: main: Assertion `fetestexcept (FE_DIVBYZERO) =3D=3D FE_DIV= BYZERO' failed. Aborted When you compare the program's lines 49 and 58, you see that the invocation fesetexceptflag (&saved_flags_2, FE_OVERFLOW) not only modified the FE_OVERFLOW flag bit, but also cleared the FE_DIVBYZE= RO flag bit. --=20 You are receiving this mail because: You are on the CC list for the bug.=