https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126558
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Thomas Koenig <[email protected]>: https://gcc.gnu.org/g:6bf6dad534766300376dec6d093d49b89a452ea1 commit r17-2878-g6bf6dad534766300376dec6d093d49b89a452ea1 Author: Thomas Koenig <[email protected]> Date: Sat Aug 1 19:03:38 2026 +0200 Fix undefined variable warning in ASSOCIATE. This patch fixes unused warnings in ASSOCIATE constructs by setting value_used and value_set attributes based on the associate names. This is placed after resolution of the code. To get to the association list, an extra argument to gfc_resolve was needed. gcc/fortran/ChangeLog: PR fortran/126558 * gfortran.h (gfc_resolve): Add optional argument for an association list. * resolve.cc (mark_assoc_used): New function. (gfc_resolve): Use it. gcc/testsuite/ChangeLog: PR fortran/126558 * gfortran.dg/warn_undefined_vars_10.f90: New test.
