]> gcc.gnu.org Git - gcc.git/commit - gcc/ada/exp_attr.adb
Fix PR ada/101970
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 14 Sep 2021 09:33:05 +0000 (11:33 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 14 Sep 2021 09:35:29 +0000 (11:35 +0200)
commitbd55fa102715c7442c050b193dadfdb5337e2377
treeef59efbca77a5066e99713f0d7ae57a8a57696a1
parent9bb20299ba1d1cc3bbd83a07a777fcc5a93cfeb0
Fix PR ada/101970

This is a regression present on the mainline and 11 branch in the form of an
ICE for an enumeration type with a full signed representation for its size.

gcc/ada/
PR ada/101970
* exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Enum_Rep>:
Use an unchecked conversion instead of a regular conversion in the
enumeration case and remove Conversion_OK flag in the integer case.
<Attribute_Pos>: Remove superfluous test.

gcc/testsuite/
* gnat.dg/enum_rep2.adb: New test.
gcc/ada/exp_attr.adb
gcc/testsuite/gnat.dg/enum_rep2.adb [new file with mode: 0644]
This page took 0.062345 seconds and 5 git commands to generate.