From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6EC403858290; Sun, 26 Jun 2022 21:21:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EC403858290 From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103707] Stray "Array operands are incommensurate" Date: Sun, 26 Jun 2022 21:21:26 +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: 11.2.0 X-Bugzilla-Keywords: rejects-valid 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: cf_reconfirmed_on cc bug_status everconfirmed 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2022 21:21:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103707 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-06-26 CC| |anlauf at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #6 from anlauf at gcc dot gnu.org --- (In reply to Thomas Koenig from comment #5) > Thanks for the quick reduction, Gerhard. >=20 > This originally came from something like >=20 > program p > real, parameter :: fmin(1) =3D 0. > real, parameter :: fmax(1) =3D 1. > real :: x(1) > where (fmin <=3D 0) > x =3D fmin + (fmax-fmin) > elsewhere > x =3D (fmax/fmin)**2 > end where > print *,x > end >=20 > so there is no division by zero at runtime. Some data points from other compiler that reject the code: NAG prints NAG Fortran Compiler Release 7.0(Yurakucho) Build 7009 Error: pr103707.f90, line 8: Floating-point divide by zero Cray versions 10 thru 14 print: x =3D (fmax/fmin)**2 ^=20=20=20=20=20=20=20=20=20 ftn-1184 crayftn: WARNING P, File =3D pr103707.f90, Line =3D 8, Column =3D = 16=20 Evaluation of this constant expression produced a NaN or other abnormal value. ^=20=20=20 ftn-1184 crayftn: WARNING P, File =3D pr103707.f90, Line =3D 8, Column =3D = 22=20 Evaluation of this constant expression produced a NaN or other abnormal value. Cray Fortran : Version 14.0.0 (20220420160222_c98838affc7b58fed2a72f164d77c35e1bc8772f) Intel and Nvidia are silent. While gfortran's error message is misleading, what is our plan? Avoid simplification in the frontend?=