diff options
author | Thomas Quinot <quinot@adacore.com> | 2006-02-15 10:39:54 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-15 10:39:54 +0100 |
commit | f55cfa2e7ffb31f3afcd63d10308574bcc9cae4a (patch) | |
tree | 5c6d9d3537674937bb0adee6d92aa7e9303ea3ac /gcc | |
parent | dad9a816687a38718a805df848ff87f8a6e8a3b8 (diff) | |
download | gcc-f55cfa2e7ffb31f3afcd63d10308574bcc9cae4a.zip gcc-f55cfa2e7ffb31f3afcd63d10308574bcc9cae4a.tar.gz gcc-f55cfa2e7ffb31f3afcd63d10308574bcc9cae4a.tar.bz2 |
exp_pakd.ads: Fix typos in comments.
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.
From-SVN: r111068
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_pakd.adb | 23 | ||||
-rw-r--r-- | gcc/ada/exp_pakd.ads | 6 |
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb index 5b0a10a..7c84a6d 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 a57b0b3..bd00459 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. |