[Ada] Deal with enumeration types with very large size

Message ID 20200619082834.GA31376@adacore.com
State New
Headers show
Series
  • [Ada] Deal with enumeration types with very large size
Related show

Commit Message

Pierre-Marie de Rodat June 19, 2020, 8:28 a.m.
It is permitted to put very large size clauses on enumeration types
so we need to deal with them in Get_Integer_Type.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_attr.adb (Get_Integer_Type): Return the largest supported
	unsigned integer type if need be.

Patch

--- gcc/ada/exp_attr.adb
+++ gcc/ada/exp_attr.adb
@@ -1766,7 +1766,7 @@  package body Exp_Attr is
             Int_Typ := Standard_Unsigned;
 
          else
-            raise Program_Error;
+            Int_Typ := Standard_Long_Long_Unsigned;
          end if;
 
          return Int_Typ;