From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2507D3858426; Fri, 6 Oct 2023 20:19:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2507D3858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696623580; bh=fgxj7ZeQIxUA+E8MuviomM4C7+ZnUfs02IzPdK+7LH0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pTdxIx3KmgUZC9RwIblz6/h1RCq2g952+Z5v+WgNSrHd8RmXukcOFAP7GSkTWWWKh KZ0Gxs5VPmW04UgP1uHKxp2GWN3Y5Yd8pDjgZavLeraqkuWisyrJRf6PCaB9AJP5Kd PeBSHJxnAvzGDyNWJNDVNaU7YAd8naFRWEJwIbGM= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/110957] -ffpe-trap and -ffpe-summary options issues Date: Fri, 06 Oct 2023 20:19:39 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf 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: attachments.created 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=3D110957 --- Comment #2 from anlauf at gcc dot gnu.org --- Created attachment 56071 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56071&action=3Dedit Patch to fix mixed up parsing of fpe options The attached patch fixes the mixup and adds the possibility to specify -ffpe-trap=3Dnone to clear previously enabled exceptions on the command lin= e. Will submit this to the list. Regarding the treatment of -f(no-)trapping-math, I played around a little bit, and I am unsure what to do. In gfortran, the option -ffpe-trap only sets the FPU mask in the main and does nothing else. Which I think is the major (sole?) purpose. On the other hand, -f(no-)trapping-math has implications that affect e.g. reassociation. Adding to gfc_post_options() something like if (gfc_option.fpe !=3D 0 && !flag_trapping_math) { gfc_warning_now (0, "Option %<-ffpe-trap=3D%> enforces " "%<-ftrapping-math%> for Fortran"); flag_trapping_math =3D 1; } will generate different warnings for -O3 -ffast-math, -Ofast, and might create more confusion than help users. I tend to think that this part should not be implemented (now), unless we better understand the implications of what a change of the defaults in gcc means to gfortran.=