summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_pakd.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-19 16:23:43 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-19 16:23:43 +0000
commitce35f5a09500166fdb3167bdeaefb26662912b4a (patch)
tree1f9d26f8d01a49005172f67ef1d1fad10e607a33 /gcc/ada/exp_pakd.adb
parentd333ad568b09cda7090714dd458be99d9d781b1c (diff)
downloadgcc-ce35f5a09500166fdb3167bdeaefb26662912b4a.tar.gz
2007-12-19 Robert Dewar <dewar@adacore.com>
* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Fix packed array type in complex case where array is Volatile. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131075 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_pakd.adb')
-rw-r--r--gcc/ada/exp_pakd.adb16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
index 9a753def146..f3ead191c96 100644
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -1430,8 +1430,20 @@ package body Exp_Pakd is
end if;
end if;
- New_Lhs := Duplicate_Subexpr (Obj, True);
- New_Rhs := Duplicate_Subexpr_No_Checks (Obj);
+ -- Now create copies removing side effects. Note that in some
+ -- complex cases, this may cause the fact that we have already
+ -- set a packed array type on Obj to get lost. So we save the
+ -- type of Obj, and make sure it is reset properly.
+
+ declare
+ T : constant Entity_Id := Etype (Obj);
+ begin
+ New_Lhs := Duplicate_Subexpr (Obj, True);
+ New_Rhs := Duplicate_Subexpr_No_Checks (Obj);
+ Set_Etype (Obj, T);
+ Set_Etype (New_Lhs, T);
+ Set_Etype (New_Rhs, T);
+ end;
-- First we deal with the "and"