From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 24C8B394D8B1; Wed, 23 Sep 2020 15:25:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24C8B394D8B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600874738; bh=adWdGhn9PX2DqethPM3TRiEcDQnc84DgaqLP697YjRc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mdqnkDKgtAdJHc2t/z9+2haVzjjErEJwehLHwpUlHCIVqFZL3jH4Ovwf8p6VgK3tk fAdz7+TWa88OlrcfCTA2KVD6iyxmDa9lCZvrgiG2cg2+/ewq6u+vYJwmhKDDqlRdKh 1iExAS+/KXXz7h5zPl5C6vTZaF86GdEEctgMuv2k= From: "markeggleston at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/82721] [8/9/10/11 Regression] Error message with corrupted text, sometimes ICE Date: Wed, 23 Sep 2020 15:25:37 +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: 8.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: minor X-Bugzilla-Who: markeggleston at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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: Wed, 23 Sep 2020 15:25:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D82721 markeggleston at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markeggleston at gcc dot g= nu.org --- Comment #10 from markeggleston at gcc dot gnu.org --- Using the bare minimum: integer :: b character(len(c)) :: b end I consistently get: 2 | character(len(c)) :: b | 1 Error: Symbol =E2=80=98b=E2=80=99 at (1) already has basic type of INTEGER pr82721temp.f90:2:14: 2 | character(len(c)) :: b | 1 Error: Statement function =E2=80=98=E2=80=99 at (1) is not allowed as an ac= tual argument The second error pops out when the following code in resolve_types (resolve= .c) is executed: for (cl =3D ns->cl_list; cl; cl =3D cl->next) resolve_charlen (cl); The list of character lengths is corrupt, the first item points to an expression of type EXPR_FUNCTION however its symtree has the name "end" ins= tead of "len" it had when it was first added to the character lengths list. When reject_statement is called for "character(len(c)) :: b" the symtree structure for "len" is deleted, unfortunately the reference to the deleted symtree structure remains untouched in the expression representing the character length. Later a symtree is created for "end" which matches the symtree referenced by the character length expression thus the name is changed to "end" and the symtree points to symbol. As an experiment using a nasty dirty hack I prevent the symtree being delet= ed if it was referenced by the expression pointed to by the length field of the charlen structure. It had not affect on the reported errors. I have since discovered that the expression that is the first argument of t= he "len" function also has a symtree that is deleted which the reference remai= ns as is. Note: the comment preceding reject_statement says: /* Undo anything tentative that has been built for the current statement, except if a gfc_charlen structure has been added to current namespace's list of gfc_charlen structure. */ Clearly this is not the case as items referenced indirectly from the gfc_charlen structure are deleted without references being touched. Further investigation is in progress.=