]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix internal error on pragma Machine_Attribute with string constant
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 26 Oct 2025 09:21:31 +0000 (10:21 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Sun, 26 Oct 2025 09:22:48 +0000 (10:22 +0100)
commitbaa73659cd03da29441004466ace3f57a05e6b8f
tree16f08e3ac75ade75eda7025564a38abaf6db4ab5
parent970c442dfe2ff28f8a7c27566d07eb62e1c8691f
Ada: Fix internal error on pragma Machine_Attribute with string constant

This was reported a long time ago and is a fairly pathological case,
so the fix is purposely ad hoc: when the attribute name of a pragma
Machine_Attribute is not a string literal, its processing needs to
be delayed for the back-end.

gcc/ada/
PR ada/13370
* sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Set the
Has_Delayed_Freeze flag if the argument is not a literal.

gcc/testsuite/
* gnat.dg/machine_attr3.ads, gnat.dg/machine_attr3.adb: New test.
gcc/ada/sem_prag.adb
gcc/testsuite/gnat.dg/machine_attr3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/machine_attr3.ads [new file with mode: 0644]