From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18E293857716; Wed, 14 Feb 2024 22:38:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18E293857716 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707950281; bh=8gkpTn1xR3mQT19AG69UlqELe+ZglgQLG/WYCHfm1oo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Oo9VpHjWs69Jn23qBS80qBB0jtvlW56gyQvUm+POH2oNStyCdXScgRz5KCqaNmVqE 95NUVrufopSWliuEipFlWC7WobscfLkCnkh9fMp8DF9iS68s+sbPOe/KvN1dFqBgR6 9x2Hvw9K0K2tJFsz8szyRkJaR2f04YEsXWAJTDU4= From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105847] namelist-object-name can be a renamed host associated entity Date: Wed, 14 Feb 2024 22:38:00 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105847 --- Comment #9 from Jerry DeLisle --- This seems to work: /* Build the namelist object name. */ - - string =3D gfc_build_cstring_const (var_name); + if (sym && !sym->attr.use_only && sym->attr.use_rename) + string =3D gfc_build_cstring_const (sym->ns->use_stmts->rename->local_= name); + else + string =3D gfc_build_cstring_const (var_name); Evidently the processing of the 'only' takes care of the renaming before we= get here. Without the attr.use_only part namelist_use_only.f90 fails. With these tweaks there are no regressions and the test case here passes.=