@@ -541,8 +541,12 @@ package body Exp_Pakd is
if Is_Itype (Typ) then
Set_Parent (Decl, Associated_Node_For_Itype (Typ));
+ Set_Associated_Node_For_Itype
+ (PAT, Associated_Node_For_Itype (Typ));
else
Set_Parent (Decl, Declaration_Node (Typ));
+ Set_Associated_Node_For_Itype
+ (PAT, Declaration_Node (Typ));
end if;
if Scope (Typ) /= Current_Scope then
@@ -11917,7 +11917,7 @@ package body Exp_Util is
-- When this routine is called while the itype
-- is being created, the entity might not yet be
- -- decorated with the associated node, but should
+ -- decorated with the associated node, but will
-- have the related expression.
if Present (Associated_Node_For_Itype (Subt)) then
@@ -11925,21 +11925,10 @@ package body Exp_Util is
Possible_Side_Effect_In_SPARK
(Associated_Node_For_Itype (Subt));
- elsif Present (Related_Expression (Subt)) then
+ else
return
Possible_Side_Effect_In_SPARK
(Related_Expression (Subt));
-
- -- When the itype doesn't have any indication of its
- -- origin (which currently only happens for packed
- -- array types created by freezing that shouldn't
- -- be picked by GNATprove anyway), then we can
- -- conservatively assume that the expression can
- -- be kept as it appears in the source code.
-
- else
- pragma Assert (Is_Packed_Array_Impl_Type (Subt));
- return False;
end if;
else
return True;
From: Piotr Trojanek <trojanek@adacore.com> After decoration, itypes should have its associated node set. gcc/ada/ * exp_pakd.adb (Create_Packed_Array_Impl_Type): Set associated node for the packed array itype. * exp_util.adb (Possible_Side_Effect_In_SPARK): Remove workaround for a missing associated node. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_pakd.adb | 4 ++++ gcc/ada/exp_util.adb | 15 ++------------- 2 files changed, 6 insertions(+), 13 deletions(-)