From: Eric Botcazou <ebotca...@adacore.com> The compiler may build modular integer subtypes whose base type is private in the context of instantiations, but we want to be able to get the Modulus.
gcc/ada/ChangeLog: * einfo.ads (Modulus): Change to implementation base type only. * gen_il-gen-gen_entities.adb (Modular_Integer_Kind): Change type of Modulus field to Impl_Base_Type_Only. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 2 +- gcc/ada/gen_il-gen-gen_entities.adb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index c07de681045..05ce8beca76 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -3626,7 +3626,7 @@ package Einfo is -- subprogram or the formal's Extra_Accessibility - whichever one is -- lesser. The Minimum_Accessibility field then points to this object. --- Modulus [base type only] +-- Modulus [implementation base type only] -- Defined in modular types. Contains the modulus. For the binary case, -- this will be a power of 2, but if Non_Binary_Modulus is set, then it -- will not be a power of 2. diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 4548789383e..2dc255c78c8 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -572,7 +572,7 @@ begin -- Gen_IL.Gen.Gen_Entities -- created for the base type, and this is the first named subtype). Ab (Modular_Integer_Kind, Integer_Kind, - (Sm (Modulus, Uint, Base_Type_Only), + (Sm (Modulus, Uint, Impl_Base_Type_Only), Sm (Original_Array_Type, Node_Id))); Cc (E_Modular_Integer_Type, Modular_Integer_Kind); -- 2.43.0