From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 68C5C3858D35; Tue, 1 Feb 2022 19:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68C5C3858D35 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/104332] [9/10/11/12 Regression] ICE in resolve_symbol, at fortran/resolve.cc:15815 Date: Tue, 01 Feb 2022 19:14:06 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 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 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: Tue, 01 Feb 2022 19:14:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104332 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to G. Steinmetz from comment #1) > Note that this addition gives an ICE down to at least r5 for some reasons= : >=20 > $ cat z3.f90 > block data > real, bind(c) :: a > end block data This is fixed by diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc index 7a80dfd063b..8f9a2bb4d95 100644 --- a/gcc/fortran/symbol.cc +++ b/gcc/fortran/symbol.cc @@ -481,6 +481,9 @@ gfc_check_conflict (symbol_attribute *attr, const char *name, locus *where) a1 =3D publik; if (attr->intent !=3D INTENT_UNKNOWN) a1 =3D intent; + /* F2018:C1416. */ + if (attr->is_bind_c !=3D INTENT_UNKNOWN) + a1 =3D is_bind_c; if (a1 !=3D NULL) { But, I think that there are conflicts in the Fortran standard. Are these code snippets equivalent? BLOCK DATA BIND(C) :: A END BLOCK DATA BLOCK DATA REAL :: A BIND(C) :: A END BLOCK DATA BLOCK DATA REAL, BIND(C) :: A END BLOCK DATA If yes, do C1415 and C1416 conflict? C1415 (R1420) A block-data specification-part shall contain only derived-type definitions and ..., BIND, ..., and type declaration statements. C1416 (R1420) A type declaration statement in a block-data specification-part shall not contain ALLOCATABLE, EXTERNAL, or BIND attribute specifiers. In fact, does C1415 conflict with C819? C819 A variable with the BIND attribute shall be declared in the specification part of a module.=