aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-11-19 12:24:53 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2004-11-19 12:24:53 +0100
commit47190c6bc99ff904e4edc67b772e1d222726b900 (patch)
treecafcece665f852b06482a6b8414798e383854e43
parentd10ad8ffac60c5c05393a22990c6f051ab877ee9 (diff)
downloadgcc-47190c6bc99ff904e4edc67b772e1d222726b900.zip
gcc-47190c6bc99ff904e4edc67b772e1d222726b900.tar.gz
gcc-47190c6bc99ff904e4edc67b772e1d222726b900.tar.bz2
exp_pakd.adb (Convert_To_PAT_Type): After replacing the original type of the object with the packed array type...
* exp_pakd.adb (Convert_To_PAT_Type): After replacing the original type of the object with the packed array type, set the Analyzed flag on the object if it is an entity or simple indexed component, to avoid spurious type errors. From-SVN: r90909
-rw-r--r--gcc/ada/exp_pakd.adb17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
index f841509..d6f47dd 100644
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -685,7 +685,24 @@ package body Exp_Pakd is
-- 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.
+
Set_Etype (Aexp, Packed_Array_Type (Act_ST));
+
+ if Is_Entity_Name (Aexp)
+ or else
+ (Nkind (Aexp) = N_Indexed_Component
+ and then Is_Entity_Name (Prefix (Aexp)))
+ then
+ Set_Analyzed (Aexp);
+ end if;
end Convert_To_PAT_Type;
------------------------------