From f235fedee9919b7396c17f2a16f6b8d0f79ee87f Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 4 Oct 2010 15:07:59 +0000 Subject: 2010-10-04 Vincent Celier * a-direct.adb (Copy_File): Interpret the Form parameter and call System.OS_Lib.Copy_File to do the work accordingly. Raise Use_Error if the Form parameter contains an incorrect value for field preserve= or mode=. * a-direct.ads (Create_Directory, Create_Path): Indicate that the Form parameter is ignored. (Copy_File): Indicate the interpretation of the Form parameter. 2010-10-04 Vincent Celier * make.adb (Gnatmake): When there are no foreign languages declared and a main in attribute Main of the main project does not exist or is a source of another project, fail immediately before attempting compilation. 2010-10-04 Javier Miranda * exp_disp.ads (Convert_Tag_To_Interface): New function which must be used to convert a node referencing a tag to a class-wide interface type. * exp_disp.adb (Convert_Tag_To_Interface): New function. (Expand_Interface_Conversion): Replace invocation of Unchecked_Conversion by new function Convert_Tag_To_Interface. (Write_DT): Add support for null primitives. * exp_ch3.adb (Expand_N_Object_Declaration): For tagged type objects, cleanup code that handles interface conversions and avoid unchecked conversion of referenced tag components. * exp_ch5.adb (Expand_N_Assignment_Statement): Code cleanup. Avoid unrequired conversions when generating a dispatching call to _assign. * sprint.adb (Write_Itype): Fix wrong output of not null access itypes. 2010-10-04 Ed Schonberg * exp_ch4.adb (Expand_N_Op_Not): Handle properly both operands when the parent is a binary boolean operation and the operand is an unpacked array. (Build_Boolean_Array_Proc_Call): If the operands are both negations, the operands of the rewritten node are the operands of the negations, not the negations themselves. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164942 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/exp_ch5.adb | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'gcc/ada/exp_ch5.adb') diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index fb1888da457..9f7e6c7abf1 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1976,14 +1976,29 @@ package body Exp_Ch5 is Reason => CE_Tag_Check_Failed)); end if; - Append_To (L, - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To (Op, Loc), - Parameter_Associations => New_List ( - Unchecked_Convert_To (F_Typ, - Duplicate_Subexpr (Lhs)), - Unchecked_Convert_To (F_Typ, - Duplicate_Subexpr (Rhs))))); + declare + Left_N : Node_Id := Duplicate_Subexpr (Lhs); + Right_N : Node_Id := Duplicate_Subexpr (Rhs); + + begin + -- In order to dispatch the call to _assign the type of + -- the actuals must match. Add conversion (if required). + + if Etype (Lhs) /= F_Typ then + Left_N := Unchecked_Convert_To (F_Typ, Left_N); + end if; + + if Etype (Rhs) /= F_Typ then + Right_N := Unchecked_Convert_To (F_Typ, Right_N); + end if; + + Append_To (L, + Make_Procedure_Call_Statement (Loc, + Name => New_Reference_To (Op, Loc), + Parameter_Associations => New_List ( + Node1 => Left_N, + Node2 => Right_N))); + end; end; else -- cgit v1.2.1