From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 845BB3858C53; Tue, 6 Feb 2024 18:19:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 845BB3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707243570; bh=fLfc55Xk0Hpk5B4Yb+PfZxOoNWijijYuL5a3+tKzxn0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ny78QfSwpBxs3ee4flyrnM01ofd6UhXhyw09WZup29PJH1OOvTalNxFCFD3AMJNwV LF5c1+I4Deab7SkOG+uQLDaT+muHzHFKlkPt19cdifJ+2hn6EcS3pYtfe//Z7abghP 5hIh4cbOkl6g2+0fG0Cby2+L4JXmzgly4Har7xIU= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/111781] Fortran compiler complains about variable bound in array dummy argument Date: Tue, 06 Feb 2024 18:19:29 +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: 12.2.0 X-Bugzilla-Keywords: patch X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mikael at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D111781 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #4 from anlauf at gcc dot gnu.org --- (In reply to Mikael Morin from comment #3) > Unfortunately, it regresses a bit, say pr101026.f for example can be > simplified to this: >=20 > SUBROUTINE PASSB4 (CC,CH) > DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) > END >=20 > which gives: >=20 > pr101026.f:4:19: >=20 > 4 | DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) > | 1 > Error: Variable =E2=80=98ido=E2=80=99 cannot appear in the expression at = (1) > pr101026.f:4:33: >=20 > 4 | DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) > | 1 > Error: Variable =E2=80=98ido=E2=80=99 cannot appear in the expression at = (1) > pr101026.f:4:25: >=20 > 4 | DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) > | 1 > Error: Variable =E2=80=98l1=E2=80=99 cannot appear in the expression at (= 1) > pr101026.f:4:37: >=20 > 4 | DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) > | 1 > Error: Variable =E2=80=98l1=E2=80=99 cannot appear in the expression at (= 1) >=20 >=20 > What I don't see is what makes the IDO and L1 variables acceptable in a > specification expression. It seems to me the errors above are valid. FWIW, NAG and Intel agree with you. With the original pr101026.f I get: NAG: Error: pr101026.f, line 4: IDO is not permitted in a specification expressi= on Error: pr101026.f, line 4: L1 is not permitted in a specification expression Error: pr101026.f, line 4: IDO is not permitted in a specification expressi= on Error: pr101026.f, line 4: L1 is not permitted in a specification expression Intel: pr101026.f(4): error #6219: This variable, used in a specification expressi= on, must be a dummy argument, a COMMON block object, or an object accessible through host or use association. [IDO] DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) -------------------^ pr101026.f(4): error #6219: This variable, used in a specification expressi= on, must be a dummy argument, a COMMON block object, or an object accessible through host or use association. [L1] DIMENSION CC(IDO,4,L1), CH(IDO,L1,*) -------------------------^ Thus I suggest to fix the testcase by one of the options suggested above.=