diff options
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index a99bed0..f1d9a97 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -9710,10 +9710,19 @@ package body Sem_Res is -------------------------------- procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id) is - Btyp : constant Entity_Id := Implementation_Base_Type (Typ); - Op : Entity_Id; - Arg1 : Node_Id; - Arg2 : Node_Id; + Is_Stoele_Mod : constant Boolean := + Nkind (N) = N_Op_Mod + and then Is_RTE (First_Subtype (Typ), RE_Storage_Offset) + and then Is_RTE (Etype (Left_Opnd (N)), RE_Address); + -- True if this is the special mod operator of System.Storage_Elements, + -- which needs to be resolved to the type of the left operand in order + -- to implement the correct semantics. + + Btyp : constant Entity_Id := + (if Is_Stoele_Mod + then Implementation_Base_Type (Etype (Left_Opnd (N))) + else Implementation_Base_Type (Typ)); + -- The base type to be used for the operator function Convert_Operand (Opnd : Node_Id) return Node_Id; -- If the operand is a literal, it cannot be the expression in a @@ -9742,6 +9751,12 @@ package body Sem_Res is return Res; end Convert_Operand; + -- Local variables + + Arg1 : Node_Id; + Arg2 : Node_Id; + Op : Entity_Id; + -- Start of processing for Resolve_Intrinsic_Operator begin |