-- Standard_Address is not user visible, but is used internally. It is
-- an unsigned type mod 2**System_Address_Size with System.Address size.
+ -- We flag it as Is_Descendant_Of_Address for code generation purposes.
Standard_Address := New_Standard_Entity ("standard_address");
Build_Unsigned_Integer_Type (Standard_Address, System_Address_Size);
+ Set_Is_Descendant_Of_Address (Standard_Address);
-- Note: universal integer and universal real are constructed as fully
-- formed signed numeric types, with parameters corresponding to the
elsif Is_Integer_Type (E) then
Adjust_Esize_For_Alignment (E);
- if Is_Modular_Integer_Type (E)
- and then Warn_On_Suspicious_Modulus_Value
- then
- Check_Suspicious_Modulus (E);
+ if Is_Modular_Integer_Type (E) then
+ -- Standard_Address has been built with the assumption that its
+ -- modulus was System_Address_Size, but this is not a universal
+ -- property and may need to be corrected.
+
+ if Is_RTE (E, RE_Address) then
+ Set_Modulus (Standard_Address, Modulus (E));
+ Set_Intval
+ (High_Bound (Scalar_Range (Standard_Address)),
+ Modulus (E) - 1);
+
+ elsif Warn_On_Suspicious_Modulus_Value then
+ Check_Suspicious_Modulus (E);
+ end if;
end if;
-- The pool applies to named and anonymous access types, but not