summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-21 09:55:51 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-21 09:55:51 +0000
commita35b881d4101ef1ce4ff2b070702b9ee0cdff182 (patch)
treeb4ba5b68e043d3f97abc249c3fb24a8b62d7feab /gcc/ada/exp_ch5.adb
parent3decff5aede5c98631436cb9293dab346287b90d (diff)
downloadgcc-a35b881d4101ef1ce4ff2b070702b9ee0cdff182.tar.gz
2010-10-21 Javier Miranda <miranda@adacore.com>
* sem_attr.adb (Resolve_Attribute): After replacing the range attribute node with a range expression ensure that its evaluation will not have side effects. * exp_ch5.adb (Expand_Assign_Array): Propagate the Parent to the unchecked conversion node generated to handle assignment of private types. Required to allow climbing the subtree if Insert_Action is invoked later. 2010-10-21 Robert Dewar <dewar@adacore.com> * par-ch3.adb (P_Interface_Type_Definition): Allow for possibility of aspect clause presence terminating the type definition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb27
1 files changed, 21 insertions, 6 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 2dbfe349dfe..7c69d5e634e 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -562,15 +562,23 @@ package body Exp_Ch5 is
-- cannot assign to elements of the array without this extra
-- unchecked conversion.
+ -- Note: We must propagate Parent to the conversion node to allow
+ -- climbing the subtree if Insert_Action is invoked later.
+
if Nkind (Act_Lhs) = N_Slice then
Larray := Prefix (Act_Lhs);
else
Larray := Act_Lhs;
if Is_Private_Type (Etype (Larray)) then
- Larray :=
- Unchecked_Convert_To
- (Underlying_Type (Etype (Larray)), Larray);
+ declare
+ Par : constant Node_Id := Parent (Larray);
+ begin
+ Larray :=
+ Unchecked_Convert_To
+ (Underlying_Type (Etype (Larray)), Larray);
+ Set_Parent (Larray, Par);
+ end;
end if;
end if;
@@ -580,9 +588,14 @@ package body Exp_Ch5 is
Rarray := Act_Rhs;
if Is_Private_Type (Etype (Rarray)) then
- Rarray :=
- Unchecked_Convert_To
- (Underlying_Type (Etype (Rarray)), Rarray);
+ declare
+ Par : constant Node_Id := Parent (Rarray);
+ begin
+ Rarray :=
+ Unchecked_Convert_To
+ (Underlying_Type (Etype (Rarray)), Rarray);
+ Set_Parent (Rarray, Par);
+ end;
end if;
end if;
@@ -1049,6 +1062,8 @@ package body Exp_Ch5 is
return Step;
end Build_Step;
+ -- Start of processing for Expand_Assign_Array_Loop
+
begin
if Rev then
F_Or_L := Name_Last;