From 07c7262ec307bd36b24943cc6014d0c0f060089e Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 5 Dec 2007 09:25:38 +0000 Subject: [PATCH] re PR ada/21489 (Wrong code generated for legal program, RM 6.4.1(13), 9.5.1(3), 9.5.3(8)) gcc/ada/ PR ada/21489 * exp_ch9.adb (Build_Simple_Entry_Call): Initialize OUT access type parameters of an entry call. gcc/testsuite/ PR ada/21489 * gnat.dg/rm_6_4_1_13.adb: New test. From-SVN: r130617 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/exp_ch9.adb | 6 +++++- gcc/testsuite/ChangeLog | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 54f3d5c9462..0fcdaad8322 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2007-12-05 Samuel Tardieu + + PR ada/21489 + * exp_ch9.adb (Build_Simple_Entry_Call): Initialize OUT access type + parameters of an entry call. + 2007-12-03 Robert Dewar Samuel Tardieu diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 87fbc1282a0..78b11553a51 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -3024,8 +3024,12 @@ package body Exp_Ch9 is -- We have to make an assignment statement separate for the -- case of limited type. We cannot assign it unless the -- Assignment_OK flag is set first. + -- An out formal of an access type must also be initialized + -- from the actual, as stated in RM 6.4.1 (13). - if Ekind (Formal) /= E_Out_Parameter then + if Ekind (Formal) /= E_Out_Parameter + or else Is_Access_Type (Etype (Formal)) + then N_Var := New_Reference_To (Defining_Identifier (N_Node), Loc); Set_Assignment_OK (N_Var); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f903d83a8cb..a58e365aca2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-12-05 Samuel Tardieu + + PR ada/21489 + * gnat.dg/rm_6_4_1_13.adb: New test. + 2007-12-04 Jakub Jelinek PR middle-end/34134