Landing: 3a8d9347f30b

Project / Subsystem

gcc / gcc/fortran

Date

2026-06-22

Author

Mikael Morin

Commit

3a8d9347f30b9d66ed6a3c7e0959c08e93ecb205

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc/fortran
patch_id
commit_hash
3a8d9347f30b9d66ed6a3c7e0959c08e93ecb205
source_type
github
headline
Fortran: Introduce dedicated type for array ranks and dimensions
tldr
Fortran frontend uses a new, bounded type for array ranks and dimensions, improving type safety.
author
Mikael Morin
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • type system
discussion_id_link
bugzilla_pr
date
2026-06-22T00:00:00.000Z

This commit introduces a new internal type, gfc_array_dim_rank_type, within the Fortran frontend to represent array ranks and dimensions. This type has stricter bounds (0 to GFC_MAX_DIMENSIONS) than the previously used signed char, providing better type safety and making these constraints known to the middle-end. The change affects array descriptors, loop iterations over dimensions, and constant initializations, with conversions added to prevent negative intermediate values.