Landing: b5b11d34f123

Project / Subsystem

gcc / ada

Date

2026-01-21

Author

Eric Botcazou

Commit

b5b11d34f1239986d87de2aa729b6efa2be277f4

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
ada
patch_id
commit_hash
b5b11d34f1239986d87de2aa729b6efa2be277f4
source_type
github
headline
Ada Fixes Differences between 'Img and 'Image for Enumeration Types.
tldr
The Ada compiler now ensures 'Img behaves like 'Image for enumeration types when using Put_Image, and folds more aggressively.
author
Eric Botcazou
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • ada
  • bugfix
  • optimization
discussion_id_link
bugzilla_pr
date
2026-01-21T00:00:00.000Z

The Ada compiler now ensures that the 'Img attribute behaves consistently with the 'Image attribute for enumeration types, as documented in the GNAT Reference Manual. This change resolves inconsistencies and implements more aggressive folding, improving performance. The implementation factors out a new procedure, Fold_Compile_Time_Known_Enumeration_Image, to handle folding of 'Img and 'Image for compile-time known values of enumeration types, excluding character types, when Put_Image is not required.