GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
fortran

Fortran parameterized derived types handle errors and improve array function results.

Fixes errors in Fortran parameterized derived types and enhances array transformational functions.

This commit addresses errors in Fortran’s parameterized derived types (PDTs), specifically in handling attribute pointers and extending result copying for array transformational functions. It ensures proper deallocation of temporary components to prevent double frees and introduces a new function to copy PDT components for intrinsic functions like MERGE and TRANSFER. A new test case verifies these fixes.

In Details

This patch modifies the Fortran front-end and intermediate representation generation for parameterized derived types (PDTs). It corrects attribute pointer handling in expr.cc and enhances result copying for array transformational functions in trans-expr.cc and trans-intrinsic.cc to correctly handle parameterized and allocatable components. The fix prevents memory leaks by deallocating temporary components and ensures consistency for intrinsic functions like MERGE and TRANSFER.

Filed Under: fortranbugfix