FRIDAY, AUGUST 28, 2026
fortran
Fortran array descriptors: Factor out unallocated library result initialization
Fortran compiler moves initialization of unallocated array descriptors for library function results to a dedicated function.
The Fortran compiler has extracted the code responsible for creating and initializing unallocated array descriptors for library function results into a new function. This improves code organization within the compiler’s intermediate representation translation phase.
In Details
The Fortran frontend introduces gfc_create_unallocated_library_result_descriptor in trans-descriptor.cc to handle the initialization of a fresh, unallocated array descriptor used for passing non-inlined intrinsic function results in reallocating assignments.
For Context
- array descriptor
- A data structure used by the Fortran compiler to represent arrays, holding information such as data pointer, type, rank, and bounds.
- unallocated
- Describes an array in Fortran that has not yet been assigned bounds and memory, typically after declaration or before being explicitly allocated.
- reallocating assignment
- In Fortran, an assignment statement where the target array's size or shape changes, requiring reallocation of memory.
- trans-descriptor.cc
- A GCC source file containing functions for creating and manipulating array descriptors during the intermediate representation (IR) translation phase.