Landing: 81a0bec12189

Project / Subsystem

gcc / fortran

Date

2026-06-05

Author

Jerry DeLisle

Commit

81a0bec12189136350dbb43969743fab8b87a212

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
fortran
patch_id
commit_hash
81a0bec12189136350dbb43969743fab8b87a212
source_type
github
headline
ALLOCATE of parameterized derived-type array initializes only first element
tldr
A Fortran compiler bug incorrectly initialized only the first element of parameterized derived-type arrays during allocation, leading to crashes due to uniniti…
author
Jerry DeLisle
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • compiler-bug
  • memory-initialization
discussion_id_link
bugzilla_pr
date
2026-06-05T00:00:00.000Z

When allocating arrays of parameterized derived types in Fortran, only the first element’s allocatable components were being initialized. This was due to an incorrect rank being passed to the initialization routines; expr->rank was 0 for array allocation expressions, even though the symbol itself represented an array. Consequently, access to subsequent elements would result in use of uninitialized pointers and program crashes. The compiler now correctly determines the array rank from the GFC array descriptor, ensuring all elements are properly initialized.