https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112764
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:dd5d399fc16ebe7a1a2b13ae8cb888d619af695c commit r13-8110-gdd5d399fc16ebe7a1a2b13ae8cb888d619af695c Author: Harald Anlauf <anl...@gmx.de> Date: Wed Nov 29 21:47:24 2023 +0100 Fortran: fix TARGET attribute of associating entity in ASSOCIATE [PR112764] The associating entity in an ASSOCIATE construct has the TARGET attribute if and only if the selector is a variable and has either the TARGET or POINTER attribute (e.g. F2018:11.1.3.3). gcc/fortran/ChangeLog: PR fortran/112764 * primary.cc (gfc_variable_attr): Set TARGET attribute of associating entity dependent on TARGET or POINTER attribute of selector. gcc/testsuite/ChangeLog: PR fortran/112764 * gfortran.dg/associate_62.f90: New test. (cherry picked from commit 951a3e3749a9bf15cea3940ad4bd76d696e1b0b6)