GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
fortran

Fortran: Fix wrongly initialized associate-name descriptor [PR121384]

Fixes an issue in Fortran's resolve_assoc_var where expressions in parentheses were incorrectly handled.

This commit corrects an error in the Fortran compiler’s resolve_assoc_var function that incorrectly handled expressions enclosed in parentheses when initializing an associate-name descriptor. The problematic code was removed, allowing the trans-stmt function to correctly process these parenthesized expressions, resolving a bug that caused incorrect program behavior.

In Details

The Fortran frontend's resolve_assoc_var procedure was mishandling expressions within parentheses when constructing trans_associate_var nodes. This commit removes the erroneous logic that attempted to use such expressions directly as targets, instead relying on trans-stmt's inherent capability to process parenthesized expressions correctly. New test cases associate_83.f90 and associate_84.f90 are added to verify the fix.

For Context
associate-name descriptor
A data structure used in Fortran to manage names associated with variables within an ASSOCIATE construct, allowing temporary local names for accessing parts of other variables.
trans-stmt
Likely refers to a transformation or translation statement within the Fortran compiler's internal representation, responsible for converting source code constructs into an intermediate form.
Filed Under: fortrancompiler bugfrontend