summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-04 09:49:42 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-04 09:49:42 +0000
commit51f2eb440adc13a7fd8e75c187725b4bed625fbb (patch)
treee7547ada839b13810d2b13de0e3cd99cf78ccffe /gcc/ada/exp_ch4.adb
parentfe8546504f2fc67065998e5ab0f99e12fe91220a (diff)
downloadgcc-51f2eb440adc13a7fd8e75c187725b4bed625fbb.tar.gz
2008-08-04 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb (Get_Allocator_Final_List): Freeze anonymous type for chain at once, to ensure that type is properly decorated for back-end, when allocator appears within a loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138597 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index ba09aa69807..1bef500b46a 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -977,8 +977,7 @@ package body Exp_Ch4 is
-- not allow sliding, but this check does (a relaxation from Ada 83).
if Is_Constrained (DesigT)
- and then not Subtypes_Statically_Match
- (T, DesigT)
+ and then not Subtypes_Statically_Match (T, DesigT)
then
Apply_Constraint_Check
(Exp, DesigT, No_Sliding => False);
@@ -8354,7 +8353,9 @@ package body Exp_Ch4 is
-- chain. The Final_Chain that is thus created is shared by the
-- access parameter. The access type is tested against the result
-- type of the function to exclude allocators whose type is an
- -- anonymous access result type.
+ -- anonymous access result type. We freeze the type at once to
+ -- ensure that it is properly decorated for the back-end, even
+ -- if the context and current scope is a loop.
if Nkind (Associated_Node_For_Itype (PtrT))
in N_Subprogram_Specification
@@ -8371,6 +8372,7 @@ package body Exp_Ch4 is
Subtype_Indication =>
New_Occurrence_Of (T, Loc))));
+ Freeze_Before (N, Owner);
Build_Final_List (N, Owner);
Set_Associated_Final_Chain (PtrT, Associated_Final_Chain (Owner));