GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
fortran

fortran: array descriptor: Move descriptor copy function [PR122521]

Fortran array descriptor copy function moved to a central location.

The copy_descriptor function, used for copying array descriptors in the Fortran front-end, has been moved from trans-stmt.cc to trans-descriptor.cc and renamed to gfc_copy_descriptor. This change consolidates descriptor handling logic into trans-descriptor.cc and updates the call site in trans_associate_var. This refactoring is part of addressing PR122521.

In Details

This commit relocates and renames the copy_descriptor function, part of the Fortran front-end's array descriptor handling, from trans-stmt.cc to trans-descriptor.cc. It is now named gfc_copy_descriptor, and its declaration is added to trans-descriptor.h. The caller trans_associate_var in trans-stmt.cc is updated accordingly. This move centralizes descriptor management functions within trans-descriptor.cc, aligning with the refactoring efforts for PR122521.

For Context
array descriptor
A data structure used by compiled Fortran code to represent an array. It typically holds information such as the array's base address, bounds, element size, and stride.
trans-stmt.cc
A source file within the GCC Fortran front-end likely containing code related to statement translation and processing, including constructs like ASSOCIATE.
trans-descriptor.cc
A source file within the GCC Fortran front-end that likely contains code related to the translation and manipulation of data descriptors, including array descriptors.
ASSOCIATE
A Fortran construct that allows temporary association of variables with other variables or expressions, often used for aliasing or simplifying access to complex data structures.
PR122521
Problem Report number 122521. This indicates a bug or issue that has been reported and is being addressed by this commit.
Filed Under: fortranrefactorcompiler internals