summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-15 09:39:54 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-15 09:39:54 +0000
commit0a496e92a8b3b846b0d3626e287331f45f749518 (patch)
tree5c6d9d3537674937bb0adee6d92aa7e9303ea3ac /gcc/ada
parent647b27635066c0c330a6112b84d150b9421d436b (diff)
downloadgcc-0a496e92a8b3b846b0d3626e287331f45f749518.tar.gz
2006-02-13 Thomas Quinot <quinot@adacore.com>
* exp_pakd.ads: Fix typos in comments. * exp_pakd.adb (Convert_To_PAT_Type): For the case of a bit packed array reference that is an explicit dereference, mark the converted (packed) array reference as analyzed to prevent a forthcoming reanalysis from resetting its type to the original (non-packed) array type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_pakd.adb23
-rw-r--r--gcc/ada/exp_pakd.ads6
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
index 5b0a10a2bc6..7c84a6d85f3 100644
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -674,7 +674,7 @@ package body Exp_Pakd is
-- The PAT is always obtained from the actual subtype
- procedure Convert_To_PAT_Type (Aexp : Entity_Id) is
+ procedure Convert_To_PAT_Type (Aexp : Node_Id) is
Act_ST : Entity_Id;
begin
@@ -682,18 +682,18 @@ package body Exp_Pakd is
Act_ST := Underlying_Type (Etype (Aexp));
Create_Packed_Array_Type (Act_ST);
- -- Just replace the etype with the packed array type. This works
+ -- Just replace the eEype with the packed array type. This works
-- because the expression will not be further analyzed, and Gigi
-- considers the two types equivalent in any case.
- -- This is not strictly the case ??? If the reference is an actual
- -- in a call, the expansion of the prefix is delayed, and must be
- -- reanalyzed, see Reset_Packed_Prefix. On the other hand, if the
- -- prefix is a simple array reference, reanalysis can produce spurious
- -- type errors when the PAT type is replaced again with the original
- -- type of the array. The following is correct and minimal, but the
- -- handling of more complex packed expressions in actuals is confused.
- -- It is likely that the problem only remains for actuals in calls.
+ -- This is not strictly the case ??? If the reference is an actual in
+ -- call, the expansion of the prefix is delayed, and must be reanalyzed,
+ -- see Reset_Packed_Prefix. On the other hand, if the prefix is a simple
+ -- array reference, reanalysis can produce spurious type errors when the
+ -- PAT type is replaced again with the original type of the array. Same
+ -- for the case of a dereference. The following is correct and minimal,
+ -- but the handling of more complex packed expressions in actuals is
+ -- confused. Probably the problem only remains for actuals in calls.
Set_Etype (Aexp, Packed_Array_Type (Act_ST));
@@ -701,6 +701,7 @@ package body Exp_Pakd is
or else
(Nkind (Aexp) = N_Indexed_Component
and then Is_Entity_Name (Prefix (Aexp)))
+ or else Nkind (Aexp) = N_Explicit_Dereference
then
Set_Analyzed (Aexp);
end if;
@@ -2584,7 +2585,7 @@ package body Exp_Pakd is
Csiz := Component_Size (Atyp);
Convert_To_PAT_Type (Obj);
- PAT := Etype (Obj);
+ PAT := Etype (Obj);
Cmask := 2 ** Csiz - 1;
diff --git a/gcc/ada/exp_pakd.ads b/gcc/ada/exp_pakd.ads
index a57b0b38b1a..bd004599944 100644
--- a/gcc/ada/exp_pakd.ads
+++ b/gcc/ada/exp_pakd.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -237,8 +237,8 @@ package Exp_Pakd is
procedure Expand_Packed_Element_Reference (N : Node_Id);
-- N is an N_Indexed_Component node whose prefix is a packed array. In
-- the bit packed case, this routine can only be used for the expression
- -- evaluation case not the assignment case, since the result is not a
- -- variable. See Expand_Bit_Packed_Element_Set for how he assignment case
+ -- evaluation case, not the assignment case, since the result is not a
+ -- variable. See Expand_Bit_Packed_Element_Set for how the assignment case
-- is handled in the bit packed case. For the enumeration case, the result
-- of this call is always a variable, so the call can be used for both the
-- expression evaluation and assignment cases.