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

Fortran PDT error handling refined with meta-bug fixes

Fortran compiler fixes minor bugs and adds tests related to parameterized derived types.

This commit refines error handling for Fortran’s parameterized derived types by addressing minor bugs in decl.cc and expr.cc. It ensures correct behavior when dealing with NULL rvalues in pointer assignments and eliminates redundant checks. A new test case, pdt_bug13.f90, is added to verify these corrections.

In Details

This change further addresses issues within the Fortran frontend related to Parameterized Derived Types (PDTs). Specifically, it modifies gfc_get_pdt_instance to eliminate redundant checks and gfc_check_pointer_assign to correctly handle cases where the right-hand side of a pointer assignment is a null expression, improving the robustness of PDT instantiation.

For Context
Parameterized Derived Type (PDT)
A derived type in Fortran whose structure depends on type parameters, similar to templates in C++ but with type parameters determined at instantiation time.
rvalue
In programming, an rvalue is an expression that represents a value which can be assigned to an lvalue. In Fortran, this typically refers to the result of an expression or function call.
NULL
In programming contexts, NULL typically represents a null pointer or a deliberately uninitialized or invalid value.
Filed Under: fortrancompiler bugs