diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a089ac4abe6..37e512b08fd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,44 @@ +2009-07-10 Thomas Quinot + + * exp_ch7.adb: Update comments. + +2009-07-10 Arnaud Charlet + + * exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod + clause if -gnatI is set instead of crashing. + +2009-07-10 Ed Schonberg + + * sem_ch11.adb (Same_Expression): Null is always equal to itself. + Additional work to remove redundant successive raise statements, in + this case access checks. + +2009-07-10 Vincent Celier + + * make.adb (Compile): Always create a deep copy of the mapping file + argument (-gnatem=...) as it may be deallocate/reallocate by + Normalize_Arguments. + +2009-07-10 Javier Miranda + + * einfo.adb (Directly_Designated_Type): Add assertion. + + * sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on + access types before using attribute Directly_Designated_Type. + +2009-07-10 Emmanuel Briot + + * prj.ads: Minor typo fix + +2009-07-10 Ed Schonberg + + * sem_ch6.adb (Add_Extra_Formal): Protected operations do no need + special treatment. + + * exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten + subprogram is a function call, resolve properly, to ensure that extra + actuals are added as needed. + 2009-07-10 Thomas Quinot * sem_aggr.adb: Minor comments editing diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index b28293a2946..f038f233599 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -808,6 +808,7 @@ package body Einfo is function Directly_Designated_Type (Id : E) return E is begin + pragma Assert (Is_Access_Type (Id)); return Node20 (Id); end Directly_Designated_Type; diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index 7d903eb6fed..3b682cf04ae 100644 --- a/gcc/ada/exp_ch13.adb +++ b/gcc/ada/exp_ch13.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2009, 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- -- @@ -396,7 +396,7 @@ package body Exp_Ch13 is AtM_Nod : Node_Id; begin - if Present (Mod_Clause (N)) then + if Present (Mod_Clause (N)) and then not Ignore_Rep_Clauses then Mod_Val := Expr_Value (Expression (Mod_Clause (N))); Citems := Pragmas_Before (Mod_Clause (N)); diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 785da600bf3..c3abeca02e8 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -3236,6 +3236,7 @@ package body Exp_Ch6 is (Passoc, Next_Named_Actual (Parent (Temp))); end loop; end; + end if; end; end if; @@ -4652,14 +4653,23 @@ package body Exp_Ch6 is end if; - Analyze (N); - -- If it is a function call it can appear in elaboration code and -- the called entity must be frozen here. if Ekind (Subp) = E_Function then Freeze_Expression (Name (N)); end if; + + -- Analyze and resolve the new call. The actuals have already been + -- resolved, but expansion of a function call will add extra actuals + -- if needed. Analysis of a procedure call already includes resolution. + + Analyze (N); + + if Ekind (Subp) = E_Function then + Resolve (N, Etype (Subp)); + end if; + end Expand_Protected_Subprogram_Call; -------------------------------- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 44da95fbf0c..bd0d371c19d 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -444,8 +444,9 @@ package body Exp_Ch7 is -- If the type is declared in a package declaration and designates a -- Taft amendment type that requires finalization, place declaration - -- of finaliztion list in the body, because no client of the package - -- can create objects of the type and thus make use of this list. + -- of finalization list in the body, because no client of the package + -- can create objects of the type and thus make use of this list. This + -- ensures the tree for the spec is identical whenever it is compiled. if Has_Completion_In_Body (Directly_Designated_Type (Typ)) and then In_Package_Body (Current_Scope) diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index f08c680a480..f91d705142f 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -3090,9 +3090,9 @@ package body Make is end if; end if; - if Create_Mapping_File then + if Create_Mapping_File and then Mapping_File_Arg /= null then Comp_Last := Comp_Last + 1; - Comp_Args (Comp_Last) := Mapping_File_Arg; + Comp_Args (Comp_Last) := new String'(Mapping_File_Arg.all); end if; Get_Name_String (S); diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 3889e66e5ea..797a4795ca9 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -669,7 +669,7 @@ package Prj is Unit : Unit_Index := No_Unit_Index; -- Name of the unit, if language is unit based. This is only set for - -- those finles that are part of the compilation set (for instance a + -- those files that are part of the compilation set (for instance a -- file in an extended project that is overridden will not have this -- field set). diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 73c966cbf53..d54c6f8a04f 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -585,6 +585,9 @@ package body Sem_Ch11 is return Same_Expression (Left_Opnd (C1), Left_Opnd (C2)) and then Same_Expression (Right_Opnd (C1), Right_Opnd (C2)); + elsif Nkind (C1) = N_Null then + return True; + else return False; end if; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 29dd6e5ed6d..9e2143ac807 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -5496,16 +5496,8 @@ package body Sem_Ch6 is (No (P_Formal) or else Present (Extra_Accessibility (P_Formal))) then - -- Temporary kludge: for now we avoid creating the extra formal - -- for access parameters of protected operations because of - -- problem with the case of internal protected calls. ??? - - if Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Definition - and then Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Body - then - Set_Extra_Accessibility - (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F")); - end if; + Set_Extra_Accessibility + (Formal, Add_Extra_Formal (Formal, Standard_Natural, E, "F")); end if; -- This label is required when skipping extra formal generation for diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 7c3eff5a9ac..8a88cd3c5c9 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -675,6 +675,7 @@ package body Sem_Res is elsif Ada_Version >= Ada_05 and then Is_Entity_Name (Pref) + and then Is_Access_Type (Etype (Pref)) and then Ekind (Directly_Designated_Type (Etype (Pref))) = E_Incomplete_Type and then Is_Tagged_Type (Directly_Designated_Type (Etype (Pref)))