Landing: cf6fe3baf828

Project / Subsystem

gcc / gcc/fortran

Date

2026-06-08

Author

Paul Thomas

Commit

cf6fe3baf828c3e6cbb4b1898ff702030ae06d5c

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc/fortran
patch_id
commit_hash
cf6fe3baf828c3e6cbb4b1898ff702030ae06d5c
source_type
github
headline
Fortran: Prevent unnecessary mallocs and frees for parameterized derived types
tldr
GCC's Fortran front end now avoids unnecessary memory allocations and deallocations for parameterized derived types.
author
Paul Thomas
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • optimization
  • memory-management
  • pdt
discussion_id_link
bugzilla_pr
date
2026-06-08T00:00:00.000Z

The Fortran front end in GCC has been optimized to reduce unnecessary memory allocations and deallocations when handling parameterized derived types (PDT). Specifically, if the bound expressions for array components or length expressions for character components simplify to a constant, the compiler will no longer set the pdt_array or pdt_string attributes respectively. This change prevents redundant heap operations, leading to improved performance for programs heavily using PDTs.