From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FD293840C19; Thu, 14 May 2020 06:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FD293840C19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589436261; bh=MonFhysoOonBGLkvx1WZQFDHhN7wDN8ontgkKnmIJio=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CQn+W/BwVUTeWoDkUxdWufRky7tIXDtn0JjwBd0ikgC38dzOBAb+FbqZxktYv5KUw lu1aBA+QmlUCHIqGr+zmxOramjBH04/uOBDvOZ5L4Fkdawnv6qv5s564DKfT/v+2N/ tDoq3X9SJrlMFoJGmhuvknZjHY8sbmt6ySTzPqLQ= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/95053] [11 regression] ICE in f951: gfc_divide() Date: Thu, 14 May 2020 06:04:21 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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 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: Thu, 14 May 2020 06:04:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95053 --- Comment #20 from anlauf at gcc dot gnu.org --- (In reply to Bill Seurer from comment #19) > There's some stuff above this in the module but this is the part that sho= ws > the error and I think it contains all the declarations. >=20 > subroutine Z() > real(r8) :: cld(99,99) > real(r8) cldeps > parameter (cldeps =3D 0.0_r8) > real(r8) asort(99) > if (cldeps > 0) then > asort(1) =3D 1.0_r8-(floor(cld(1,7)/cldeps)*cldeps) > endif > return > end subroutine Z >=20 > 15 | asort(1) =3D 1.0_r8-(floor(cld(1,7)/cldeps)*cldeps) > | 1 > Error: Division by zero at (1) Thanks for the small example. The parameter statement makes cldeps to a constant that is zero when that line is processed. Arguably that is borderline code. I see two ways around: 1) either replace the parameter statement for cldeps by an initialization: data cldeps / 0.0_r8 / 2) or add -fno-range-check to the command line. I could adjust the error message so that you get an approprate hint how to switch off that error. What do you think?=