From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 341083858D28; Thu, 29 Sep 2022 09:20:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 341083858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664443214; bh=nJxWUgca1MG9DpzDmfW9zD8BcO0BBrqzPmpQA3IMdCo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bOidaoRat0t5zs5dZsCmGOrbjL7cw31Vmpylsbjy+2g6GQ0d32T+youfkL++OWTPW gw0Xg18vLnjGYxszwjSOWaZZ23uP0NGBy6D41Wmr9HtlCE5cfgWl8WDH8AQY8tI2iq mgq8ONLm/g4pVDNTu/sJl5p5eEb6YPUEYEbuTnoQ= From: "fxcoudert at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107071] gfortran.dg/ieee/modes_1.f90 fails on aarch64-linux Date: Thu, 29 Sep 2022 09:20:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: fxcoudert at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107071 --- Comment #5 from Francois-Xavier Coudert = --- Right now the code to test support is indeed like this for glibc targets ex= cept x86/x86_64 (libgfortran/config/fpu-glibc.h): int support_fpu_rounding_mode (int mode) { switch (mode) { case GFC_FPE_TONEAREST: #ifdef FE_TONEAREST return 1; #else return 0; #endif =E2=80=A6 so the correct code would be instead: int support_fpu_rounding_mode (int mode) { int oldmode, res; switch (mode) { case GFC_FPE_TONEAREST: #ifdef FE_TONEAREST oldmode =3D fegetround (); res =3D fesetround (FE_TONEAREST); fesetround (oldmode); return res ? 0 : 1; #else return 0; #endif =E2=80=A6 Does that seem correct to you? Also, looking at the doc, I think this file may need to have this line somewhere at the top: #pragma STDC FENV_ACCESS ON=