]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix missing names for 'Image of enumeration type
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 7 Jun 2026 20:30:56 +0000 (22:30 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 19 Jun 2026 13:05:28 +0000 (15:05 +0200)
commit8d591bae993485db48852c19dd8611441ebecb22
treec59dc4ab4181c362a5071fa327afc1087826df09
parent363950a80d3d9848f89441ac00fc2915f123171f
ada: Fix missing names for 'Image of enumeration type

This is a freezing issue introduced by the recent coupling of assertions and
Ghost mode, which are supposed to use different paths in the freezing code.

In light of this, it appears to be wise to undo the coupling and restore the
clear separation between the two different mechanisms.  The price to pay is
the loss of the "assertion would fail at run time" warning for non-static
assertions that are disabled (it is still present for static assertions),
which seems to be an acceptable trade-off to avoid nasty freezing issues.

gcc/ada/ChangeLog:

* expander.adb (Expand): Revert latest change.
* ghost.adb (Set_Ghost_Mode): Likewise.
* sem_ch3.adb (Analyze_Subtype_Declaration): Also copy the RM size
for floating-point types.
* sem_prag.adb (Analyze_Pragma) <Pragma_Check>: Do not mark the
pragma as Ghost when expander is active and the pragma is ignored.
Preanalyze it instead of analyzing it, and rewrite it as a null
statement at the end of the processing.
gcc/ada/expander.adb
gcc/ada/ghost.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb