diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-05 09:57:10 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-05 09:57:10 +0000 |
commit | fa6a69495112e877ca542914aa71650699d821cb (patch) | |
tree | ca558945029a1751f81049619541e389d3223bf3 | |
parent | a02740bf3317a567a563ee9dde43500466a07ea3 (diff) | |
download | ppe42-gcc-fa6a69495112e877ca542914aa71650699d821cb.tar.gz ppe42-gcc-fa6a69495112e877ca542914aa71650699d821cb.zip |
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb: Do not elaborate type definition if syntax error.
2010-10-05 Javier Miranda <miranda@adacore.com>
* sprint.adb (Sprint_Node_Actual): Improve output of subprogram bodies
to generate the full-qualified names of its corresponding spec.
This facilitates locating the corresponing body when reading
the DG output.
2010-10-05 Thomas Quinot <quinot@adacore.com>
* exp_dist.adb (Make_Helper_Function_Name): For a tagged type, use
canonical name without serial number only if the helper is becoming a
primitive of the type.
2010-10-05 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Make_DT): Minor code reorganization.
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* par-ch6.adb: improve recovery with extra paren in function spec.
2010-10-05 Quentin Ochem <ochem@adacore.com>
* prj-tree.ads: Project_Path is now aliased.
2010-10-05 Thomas Quinot <quinot@adacore.com>
* checks.adb: Minor reformatting.
2010-10-05 Eric Botcazou <ebotcazou@adacore.com>
* mlib-tgt-specific-mingw.adb (No_Argument_List): Delete.
(Shared_Libgcc): New aliased variable.
(Shared_Libgcc_Switch): New constant.
(Build_Dynamic_Library): Pass Shared_Libgcc_Switch to the compiler
* gcc-interface/Makefile.in (gnatlib-shared-win32): Pass -shared-libgcc
to the compiler.
2010-10-05 Vincent Celier <celier@adacore.com>
* prj-part.adb (Parse_Simple_Project): When checking if a child project
imports its parent project, also look in projects being extended by
imported projects.
2010-10-05 Eric Botcazou <ebotcazou@adacore.com>
* gnat_ugn.texi: Adjust instructions in G.10 Building DLLs with GNAT.
2010-10-05 Javier Miranda <miranda@adacore.com>
* exp_cg.adb (Slot_Number): Add support to handle aliased entities.
(Generate_CG_Output): Switch -gnatd.Z is no longer needed to
activate this output.
2010-10-05 Arnaud Charlet <charlet@adacore.com>
* back_end.adb (Call_Back_End): Generate an error message when scil
generation is enabled, and no scil back-end (by default) is available.
2010-10-05 Javier Miranda <miranda@adacore.com>
* debug.adb: Update documentation because -gnatd.Z is no longer required
to generate the call-graph information.
2010-10-05 Javier Miranda <miranda@adacore.com>
* exp_ch5.adb (Expand_Simple_Function_Return): Rewrite expansion of a
runtime access check by an equivalent expansion that causes
no problems in the VM backend. The original expansion was
not good for the VM backends because when Tagged_Type_Expansion
is disabled the attribute Access_Disp_Table is not available.
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_type.adb (Covers): In a dispatching context, T1 covers T2 if T2
is class-wide and T1 is its specific type.
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* einfo.adb: Add guard to Is_String_Type to prevent cascaded errors.
2010-10-05 Vincent Celier <celier@adacore.com>
* back_end.ads: Minor spelling error correction.
2010-10-05 Arnaud Charlet <charlet@adacore.com>
* switch-c.adb, gnat1drv.adb (Scan_Front_End_Switches): Disable
warnings when -gnatC is specified here so that warnings can be
re-enabled explicitly.
(Adjust_Global_Switches): No longer suppress warnings.
2010-10-05 Vincent Celier <celier@adacore.com>
* makeutl.adb: Minor reformatting.
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb: add guard in Analyze_One_Call to prevent crash when a
non-discrete type appears as an actual in a call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164976 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 144 | ||||
-rw-r--r-- | gcc/ada/back_end.adb | 12 | ||||
-rw-r--r-- | gcc/ada/back_end.ads | 2 | ||||
-rw-r--r-- | gcc/ada/checks.adb | 6 | ||||
-rw-r--r-- | gcc/ada/debug.adb | 2 | ||||
-rw-r--r-- | gcc/ada/einfo.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_cg.adb | 14 | ||||
-rw-r--r-- | gcc/ada/exp_ch5.adb | 11 | ||||
-rw-r--r-- | gcc/ada/exp_disp.adb | 12 | ||||
-rw-r--r-- | gcc/ada/exp_dist.adb | 28 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Make-lang.in | 45 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Makefile.in | 6 | ||||
-rw-r--r-- | gcc/ada/gnat1drv.adb | 14 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 8 | ||||
-rw-r--r-- | gcc/ada/makeutl.adb | 3 | ||||
-rw-r--r-- | gcc/ada/mlib-tgt-specific-mingw.adb | 10 | ||||
-rw-r--r-- | gcc/ada/par-ch6.adb | 16 | ||||
-rw-r--r-- | gcc/ada/prj-part.adb | 17 | ||||
-rw-r--r-- | gcc/ada/prj-tree.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 5 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 22 | ||||
-rw-r--r-- | gcc/ada/sem_type.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sprint.adb | 8 | ||||
-rw-r--r-- | gcc/ada/switch-c.adb | 14 |
24 files changed, 315 insertions, 97 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 005168fae0c..0d57cde28b4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,149 @@ 2010-10-05 Ed Schonberg <schonberg@adacore.com> + * sem_ch3.adb: Do not elaborate type definition if syntax error. + +2010-10-05 Javier Miranda <miranda@adacore.com> + + * sprint.adb (Sprint_Node_Actual): Improve output of subprogram bodies + to generate the full-qualified names of its corresponding spec. + This facilitates locating the corresponing body when reading + the DG output. + +2010-10-05 Thomas Quinot <quinot@adacore.com> + + * exp_dist.adb (Make_Helper_Function_Name): For a tagged type, use + canonical name without serial number only if the helper is becoming a + primitive of the type. + +2010-10-05 Javier Miranda <miranda@adacore.com> + + * exp_disp.adb (Make_DT): Minor code reorganization. + +2010-10-05 Ed Schonberg <schonberg@adacore.com> + + * par-ch6.adb: improve recovery with extra paren in function spec. + +2010-10-05 Quentin Ochem <ochem@adacore.com> + + * prj-tree.ads: Project_Path is now aliased. + +2010-10-05 Thomas Quinot <quinot@adacore.com> + + * checks.adb: Minor reformatting. + +2010-10-05 Eric Botcazou <ebotcazou@adacore.com> + + * mlib-tgt-specific-mingw.adb (No_Argument_List): Delete. + (Shared_Libgcc): New aliased variable. + (Shared_Libgcc_Switch): New constant. + (Build_Dynamic_Library): Pass Shared_Libgcc_Switch to the compiler + * gcc-interface/Makefile.in (gnatlib-shared-win32): Pass -shared-libgcc + to the compiler. + * gcc-interface/Make-lang.in: Update dependencies. + +2010-10-05 Vincent Celier <celier@adacore.com> + + * prj-part.adb (Parse_Simple_Project): When checking if a child project + imports its parent project, also look in projects being extended by + imported projects. + +2010-10-05 Eric Botcazou <ebotcazou@adacore.com> + + * gnat_ugn.texi: Adjust instructions in G.10 Building DLLs with GNAT. + +2010-10-05 Javier Miranda <miranda@adacore.com> + + * exp_cg.adb (Slot_Number): Add support to handle aliased entities. + (Generate_CG_Output): Switch -gnatd.Z is no longer needed to + activate this output. + +2010-10-05 Arnaud Charlet <charlet@adacore.com> + + * back_end.adb (Call_Back_End): Generate an error message when scil + generation is enabled, and no scil back-end (by default) is available. + +2010-10-05 Javier Miranda <miranda@adacore.com> + + * debug.adb: Update documentation because -gnatd.Z is no longer required + to generate the call-graph information. + +2010-10-05 Javier Miranda <miranda@adacore.com> + + * exp_ch5.adb (Expand_Simple_Function_Return): Rewrite expansion of a + runtime access check by an equivalent expansion that causes + no problems in the VM backend. The original expansion was + not good for the VM backends because when Tagged_Type_Expansion + is disabled the attribute Access_Disp_Table is not available. + +2010-10-05 Ed Schonberg <schonberg@adacore.com> + + * sem_type.adb (Covers): In a dispatching context, T1 covers T2 if T2 + is class-wide and T1 is its specific type. + +2010-10-05 Ed Schonberg <schonberg@adacore.com> + + * einfo.adb: Add guard to Is_String_Type to prevent cascaded errors. + +2010-10-05 Vincent Celier <celier@adacore.com> + + * back_end.ads: Minor spelling error correction. + +2010-10-05 Arnaud Charlet <charlet@adacore.com> + + * switch-c.adb, gnat1drv.adb (Scan_Front_End_Switches): Disable + warnings when -gnatC is specified here so that warnings can be + re-enabled explicitly. + (Adjust_Global_Switches): No longer suppress warnings. + +2010-10-05 Vincent Celier <celier@adacore.com> + + * makeutl.adb: Minor reformatting. + +2010-10-05 Ed Schonberg <schonberg@adacore.com> + + * sem_ch4.adb: add guard in Analyze_One_Call to prevent crash when a + non-discrete type appears as an actual in a call. + +2010-10-05 Vincent Celier <celier@adacore.com> + + * make.adb (Scan_Make_Arg): Take into account new switch + --source-info=file. + * makeusg.adb: Add line for new switch --source-info=file. + * makeutl.ads (Source_Info_Option): New constant String for new builder + switch. + * prj-conf.adb: Put subprograms in alphabetical order + (Process_Project_And_Apply_Config): Read/write an eventual source info + file, if necessary. + * prj-nmsc.adb (Look_For_Sources.Get_Sources_From_Source_Info): New + procedure. + (Look_For_Sources): If a source info file was successfully read, get the + source data from the data read from the source info file. + * prj-util.adb (Source_Info_Table): New table + (Source_Info_Project_HTable): New hash table + (Create): New procedure + (Put (File), Put_Line): New procedures + (Write_Source_Info_File): New procedure + (Read_Source_Info_File): New procedure + (Initialize): New procedure + (Source_Info_Of): New procedure + (Next): New procedure + (Close): When file is an out file, fail if the buffer cannot be written + or if the file cannot be close successfully. + (Get_Line): Fail if file is an out file + * prj-util.ads (Create): New procedure + (Put (File), Put_Line): New procedures + (Write_Source_Info_File): New procedure + (Read_Source_Info_File): New procedure + (Source_Info_Data): New record type + (Source_Info_Iterator): New private type + (Initialize): New procedure + (Source_Info_Of): New procedure + (Next): New procedure + * prj.ads (Project_Tree_Data): New components Source_Info_File_Name and + Source_Info_File_Exists. + +2010-10-05 Ed Schonberg <schonberg@adacore.com> + * exp_ch4.adb: Fix typo. 2010-10-05 Thomas Quinot <quinot@adacore.com> diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index ee93f140796..697ad484d2a 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -26,6 +26,7 @@ with Atree; use Atree; with Debug; use Debug; with Elists; use Elists; +with Errout; use Errout; with Lib; use Lib; with Osint; use Osint; with Opt; use Opt; @@ -118,6 +119,17 @@ package body Back_End is File_Info_Array (J).Num_Source_Lines := Num_Source_Lines (J); end loop; + if Generate_SCIL then + Error_Msg_N ("'S'C'I'L generation not available", Cunit (Main_Unit)); + + if CodePeer_Mode + or else (Mode /= Generate_Object + and then not Back_Annotate_Rep_Info) + then + return; + end if; + end if; + gigi (gnat_root => Int (Cunit (Main_Unit)), max_gnat_node => Int (Last_Node_Id - First_Node_Id + 1), diff --git a/gcc/ada/back_end.ads b/gcc/ada/back_end.ads index fb11939a064..93e1ba64381 100644 --- a/gcc/ada/back_end.ads +++ b/gcc/ada/back_end.ads @@ -35,7 +35,7 @@ package Back_End is Declarations_Only, -- Partial back end operation with no object file generation. In this -- mode the only useful action performed by gigi is to process all - -- declarations issuing any error messages (in partcicular those to + -- declarations issuing any error messages (in particular those to -- do with rep clauses), and to back annotate representation info. Skip); diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index b67e8d6d66c..e73f644025b 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -4099,13 +4099,13 @@ package body Checks is end if; end if; - -- If this is a boolean expression, only its elementary consituents need + -- If this is a boolean expression, only its elementary operands need -- checking: if they are valid, a boolean or short-circuit operation -- with them will be valid as well. if Base_Type (Typ) = Standard_Boolean - and then - (Nkind (Expr) in N_Op or else Nkind (Expr) in N_Short_Circuit) + and then + (Nkind (Expr) in N_Op or else Nkind (Expr) in N_Short_Circuit) then return; end if; diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index bbf86466eae..ba2845ddbfa 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -143,7 +143,7 @@ package body Debug is -- d.W Print out debugging information for Walk_Library_Items -- d.X Use Expression_With_Actions -- d.Y Do not use Expression_With_Actions - -- d.Z Generate call-graph information + -- d.Z -- d1 Error msgs have node numbers where possible -- d2 Eliminate error flags in verbose form error messages diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 24461c29db7..ef0efdf72a5 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -6182,6 +6182,7 @@ package body Einfo is begin return Ekind (Id) in String_Kind or else (Is_Array_Type (Id) + and then Id /= Any_Composite and then Number_Dimensions (Id) = 1 and then Is_Character_Type (Component_Type (Id))); end Is_String_Type; @@ -7701,7 +7702,8 @@ package body Einfo is E_Generic_Package => Write_Str ("Renamed_Entity"); - when Incomplete_Or_Private_Kind => + when Incomplete_Or_Private_Kind | + E_Record_Subtype => Write_Str ("Private_Dependents"); when Concurrent_Kind => diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb index 4aa7b0b6397..f549c58e411 100644 --- a/gcc/ada/exp_cg.adb +++ b/gcc/ada/exp_cg.adb @@ -24,7 +24,6 @@ ------------------------------------------------------------------------------ with Atree; use Atree; -with Debug; use Debug; with Einfo; use Einfo; with Elists; use Elists; with Exp_Disp; use Exp_Disp; @@ -110,11 +109,9 @@ package body Exp_CG is begin -- No output if the "ci" output file has not been previously opened - -- by toplev.c. Temporarily the output is also disabled with -gnatd.Z + -- by toplev.c - if Callgraph_Info_File = Null_Address - or else not Debug_Flag_Dot_ZZ - then + if Callgraph_Info_File = Null_Address then return; end if; @@ -393,11 +390,12 @@ package body Exp_CG is ----------------- function Slot_Number (Prim : Entity_Id) return Uint is + E : constant Entity_Id := Ultimate_Alias (Prim); begin - if Is_Predefined_Dispatching_Operation (Prim) then - return -DT_Position (Prim); + if Is_Predefined_Dispatching_Operation (E) then + return -DT_Position (E); else - return DT_Position (Prim); + return DT_Position (E); end if; end Slot_Number; diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 60593b590c2..47b15d7ce83 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -27,7 +27,6 @@ with Atree; use Atree; with Checks; use Checks; with Debug; use Debug; with Einfo; use Einfo; -with Elists; use Elists; with Exp_Atag; use Exp_Atag; with Exp_Aggr; use Exp_Aggr; with Exp_Ch6; use Exp_Ch6; @@ -4145,13 +4144,11 @@ package body Exp_Ch5 is Make_Selected_Component (Loc, Prefix => Duplicate_Subexpr (Exp), Selector_Name => - New_Reference_To (First_Tag_Component (Utyp), Loc)), + Make_Identifier (Loc, Chars => Name_uTag)), Right_Opnd => - Unchecked_Convert_To (RTE (RE_Tag), - New_Reference_To - (Node (First_Elmt - (Access_Disp_Table (Base_Type (Utyp)))), - Loc))), + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Base_Type (Utyp), Loc), + Attribute_Name => Name_Tag)), Reason => CE_Tag_Check_Failed)); -- If the result type is a specific nonlimited tagged type, then we diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 392fa7c2eba..2bbe2ae7995 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -5022,6 +5022,7 @@ package body Exp_Disp is declare Prim_Elmt : Elmt_Id; Prim : Entity_Id; + Size_Comp : Node_Id; begin Prim_Elmt := First_Elmt (Primitive_Operations (Typ)); @@ -5032,15 +5033,15 @@ package body Exp_Disp is Prim := Ultimate_Alias (Prim); if Is_Abstract_Subprogram (Prim) then - Append_To (TSD_Aggr_List, + Size_Comp := Unchecked_Convert_To (RTE (RE_Size_Ptr), - New_Reference_To (RTE (RE_Null_Address), Loc))); + New_Reference_To (RTE (RE_Null_Address), Loc)); else - Append_To (TSD_Aggr_List, + Size_Comp := Unchecked_Convert_To (RTE (RE_Size_Ptr), Make_Attribute_Reference (Loc, Prefix => New_Reference_To (Prim, Loc), - Attribute_Name => Name_Unrestricted_Access))); + Attribute_Name => Name_Unrestricted_Access)); end if; exit; @@ -5048,6 +5049,9 @@ package body Exp_Disp is Next_Elmt (Prim_Elmt); end loop; + + pragma Assert (Present (Size_Comp)); + Append_To (TSD_Aggr_List, Size_Comp); end; end if; end if; diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index 00bdeaf5113..545fda96747 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -10549,9 +10549,9 @@ package body Exp_Dist is if Is_Itype (Typ) and then Typ /= Base_Type (Typ) then Build_TypeCode_Function (Loc => Loc, - Typ => Etype (Typ), - Decl => Decl, - Fnam => Fnam); + Typ => Etype (Typ), + Decl => Decl, + Fnam => Fnam); return; end if; @@ -11036,26 +11036,30 @@ package body Exp_Dist is begin declare Serial : Nat := 0; - -- For tagged types, we use a canonical name so that it matches - -- the primitive spec. For all other cases, we use a serialized - -- name so that multiple generations of the same procedure do - -- not clash. + -- For tagged types that aren't frozen yet, generate the helper + -- under its canonical name so that it matches the primitive + -- spec. For all other cases, we use a serialized name so that + -- multiple generations of the same procedure do not clash. begin - if not Is_Tagged_Type (Typ) then + if Is_Tagged_Type (Typ) and then not Is_Frozen (Typ) then + null; + + else Serial := Increment_Serial_Number; end if; - -- Use prefixed underscore to avoid potential clash with used + -- Use prefixed underscore to avoid potential clash with user -- identifier (we use attribute names for Nam). return Make_Defining_Identifier (Loc, Chars => New_External_Name - (Related_Id => Nam, - Suffix => ' ', Suffix_Index => Serial, - Prefix => '_')); + (Related_Id => Nam, + Suffix => ' ', + Suffix_Index => Serial, + Prefix => '_')); end; end Make_Helper_Function_Name; end Helpers; diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 427f8081163..752c02db3f5 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -1815,30 +1815,31 @@ ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \ - ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \ - ada/exp_ch3.ads ada/exp_ch3.adb ada/exp_ch4.ads ada/exp_ch6.ads \ - ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads \ - ada/exp_pakd.ads ada/exp_smem.ads ada/exp_strm.ads ada/exp_tss.ads \ - ada/exp_tss.adb ada/exp_util.ads ada/exp_util.adb ada/fname.ads \ - ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \ - ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \ + ada/exp_aggr.ads ada/exp_atag.ads ada/exp_cg.ads ada/exp_ch11.ads \ + ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch3.adb ada/exp_ch4.ads \ + ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_dbug.ads \ + ada/exp_disp.ads ada/exp_disp.adb ada/exp_dist.ads ada/exp_pakd.ads \ + ada/exp_smem.ads ada/exp_strm.ads ada/exp_tss.ads ada/exp_tss.adb \ + ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \ + ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ + ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/layout.ads \ ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ - ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/sem.ads \ - ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_cat.ads \ - ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \ - ada/sem_eval.ads ada/sem_mech.ads ada/sem_res.ads ada/sem_scil.ads \ - ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ - ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \ - ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \ - ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \ - ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \ - ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ - ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ - ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ - ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ - ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ - ada/unchdeal.ads ada/urealp.ads ada/validsw.ads + ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scil_ll.ads \ + ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_aux.adb \ + ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads \ + ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_mech.ads \ + ada/sem_res.ads ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads \ + ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \ + ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \ + ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \ + ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \ + ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ + ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \ + ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ + ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ + ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ + ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 6eedaa58984..a98d61e993f 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -2561,11 +2561,13 @@ gnatlib-shared-win32: THREAD_KIND="$(THREAD_KIND)" \ gnatlib $(RM) $(RTSDIR)/libgna*$(soext) - cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ + cd $(RTSDIR); ../../xgcc -B../../ -shared -shared-libgcc \ + $(TARGET_LIBGCC2_CFLAGS) \ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB) - cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \ + cd $(RTSDIR); ../../xgcc -B../../ -shared -shared-libgcc \ + $(TARGET_LIBGCC2_CFLAGS) \ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ $(GNATRTL_TASKING_OBJS) \ $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 7a72e190405..1fad814cf6c 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -230,14 +230,12 @@ procedure Gnat1drv is Assertions_Enabled := True; Debug_Pragmas_Enabled := True; - -- Suppress compiler warnings, since what we are interested in here - -- is what CodePeer can find out. Also disable all simple value - -- propagation. This is an optimization which is valuable for code - -- optimization, and also for generation of compiler warnings, but - -- these are being turned off anyway, and CodePeer understands - -- things more clearly if references are not optimized in this way. - - Warning_Mode := Suppress; + -- Disable all simple value propagation. This is an optimization + -- which is valuable for code optimization, and also for generation + -- of compiler warnings, but these are being turned off by default, + -- and CodePeer generates better messages (referencing original + -- variables) this way. + Debug_Flag_MM := True; -- Set normal RM validity checking, and checking of IN OUT parameters diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index d6d003996bf..3c00382cec9 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -27716,11 +27716,11 @@ into the DLL. This is done by using the standard @command{gnatmake} tool. @item building the DLL -To build the DLL you must use @command{gcc}'s @option{-shared} -option. It is quite simple to use this method: +To build the DLL you must use @command{gcc}'s @option{-shared} and +@option{-shared-libgcc} options. It is quite simple to use this method: @smallexample -$ gcc -shared -o api.dll obj1.o obj2.o @dots{} +$ gcc -shared -shared-libgcc -o api.dll obj1.o obj2.o @dots{} @end smallexample It is important to note that in this case all symbols found in the @@ -27729,7 +27729,7 @@ the set of symbols to export by passing to @command{gcc} a definition file, @pxref{The Definition File}. For example: @smallexample -$ gcc -shared -o api.dll api.def obj1.o obj2.o @dots{} +$ gcc -shared -shared-libgcc -o api.dll api.def obj1.o obj2.o @dots{} @end smallexample If you use a definition file you must export the elaboration procedures diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb index a11f2613496..44adcd4e2f3 100644 --- a/gcc/ada/makeutl.adb +++ b/gcc/ada/makeutl.adb @@ -38,9 +38,8 @@ with Tempdir; with Ada.Command_Line; use Ada.Command_Line; -with GNAT.Directory_Operations; use GNAT.Directory_Operations; - with GNAT.Case_Util; use GNAT.Case_Util; +with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.HTable; package body Makeutl is diff --git a/gcc/ada/mlib-tgt-specific-mingw.adb b/gcc/ada/mlib-tgt-specific-mingw.adb index 704071a14ab..f1eedf5f234 100644 --- a/gcc/ada/mlib-tgt-specific-mingw.adb +++ b/gcc/ada/mlib-tgt-specific-mingw.adb @@ -7,7 +7,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2010, 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- -- @@ -61,8 +61,10 @@ package body MLib.Tgt.Specific is function PIC_Option return String; - No_Argument_List : constant String_List := (1 .. 0 => null); - -- Used as value of parameter Options or Options2 in calls to Gcc + Shared_Libgcc : aliased String := "-shared-libgcc"; + + Shared_Libgcc_Switch : constant Argument_List := + (1 => Shared_Libgcc'Access); --------------------------- -- Build_Dynamic_Library -- @@ -99,7 +101,7 @@ package body MLib.Tgt.Specific is Tools.Gcc (Output_File => Lib_File, Objects => Ofiles, - Options => No_Argument_List, + Options => Shared_Libgcc_Switch, Options_2 => Options, Driver_Name => Driver_Name); end Build_Dynamic_Library; diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index 3830e05cb1a..17e3f8517e1 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -224,10 +224,8 @@ package body Ch6 is -- case is for subunits. if Pf_Flags /= Pf_Decl_Gins_Pbod_Rnam_Stub - and then - Pf_Flags /= Pf_Decl_Pbod - and then - Pf_Flags /= Pf_Pbod + and then Pf_Flags /= Pf_Decl_Pbod + and then Pf_Flags /= Pf_Pbod then Error_Msg_SC ("overriding indicator not allowed here!"); @@ -376,9 +374,17 @@ package body Ch6 is end if; else + -- Skip extra parenthesis at end of formal part, and if + -- function scan result subtype. + + Ignore (Tok_Right_Paren); + if Func then - Ignore (Tok_Right_Paren); TF_Return; + + if Prev_Token = Tok_Return then + Result_Node := P_Subtype_Mark; + end if; end if; end if; diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb index 93b6f260b57..cc058b60022 100644 --- a/gcc/ada/prj-part.adb +++ b/gcc/ada/prj-part.adb @@ -1653,6 +1653,7 @@ package body Prj.Part is Parent_Node : Project_Node_Id := Empty_Node; With_Clause : Project_Node_Id := First_With_Clause_Of (Project, In_Tree); + Imp_Proj_Name : Name_Id; begin -- If there is an extended project, check its name @@ -1666,11 +1667,23 @@ package body Prj.Part is -- If the parent project is not the extended project, -- check each imported project until we find the parent project. + Imported_Loop : while not Parent_Found and then Present (With_Clause) loop Parent_Node := Project_Node_Of (With_Clause, In_Tree); - Parent_Found := Name_Of (Parent_Node, In_Tree) = Parent_Name; + + Extension_Loop : + while Present (Parent_Node) loop + Imp_Proj_Name := Name_Of (Parent_Node, In_Tree); + Parent_Found := Imp_Proj_Name = Parent_Name; + exit Imported_Loop when Parent_Found; + Parent_Node := + Extended_Project_Of + (Project_Declaration_Of (Parent_Node, In_Tree), + In_Tree); + end loop Extension_Loop; + With_Clause := Next_With_Clause_Of (With_Clause, In_Tree); - end loop; + end loop Imported_Loop; if Parent_Found then Set_Parent_Project_Of (Project, In_Tree, To => Parent_Node); diff --git a/gcc/ada/prj-tree.ads b/gcc/ada/prj-tree.ads index 889d3f17913..5ed88d5e5f6 100644 --- a/gcc/ada/prj-tree.ads +++ b/gcc/ada/prj-tree.ads @@ -1475,7 +1475,7 @@ package Prj.Tree is -- The target name, if any, specified with the gprbuild or gprclean -- switch --target=. - Project_Path : Prj.Env.Project_Search_Path; + Project_Path : aliased Prj.Env.Project_Search_Path; -- The project path is tree specific, since we might want to load -- simultaneously multiple projects, each with its own search path, in -- particular when using different compilers with different default diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index a48ce30f23b..0b66cd6ece5 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -4060,6 +4060,11 @@ package body Sem_Ch3 is when N_Record_Definition => Record_Type_Declaration (T, N, Prev); + -- If declaration has a parse error, nothing to elaborate. + + when N_Error => + null; + when others => raise Program_Error; diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index ccc5575f4c5..35c1553a0a9 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -6097,14 +6097,24 @@ package body Sem_Ch4 is and then Is_Type (Entity (Actual)) and then No (Next (Actual)) then - Rewrite (N, - Make_Slice (Loc, - Prefix => Make_Function_Call (Loc, - Name => Relocate_Node (Name (N))), + -- A single actual that is a type name indicates a slice if the + -- type is discrete, and an error otherwise. + + if Is_Discrete_Type (Entity (Actual)) then + Rewrite (N, + Make_Slice (Loc, + Prefix => Make_Function_Call (Loc, + Name => Relocate_Node (Name (N))), Discrete_Range => - New_Occurrence_Of (Entity (Actual), Sloc (Actual)))); + New_Occurrence_Of (Entity (Actual), Sloc (Actual)))); + + Analyze (N); + + else + Error_Msg_N ("invalid use of type in expression", Actual); + Set_Etype (N, Any_Type); + end if; - Analyze (N); return True; elsif not Has_Compatible_Type (Actual, Etype (Index)) then diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index bc68f3801b3..44f6960c0c2 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -876,10 +876,13 @@ package body Sem_Type is return False; end; - -- In a dispatching call the actual may be class-wide + -- In a dispatching call the actual may be class-wide, the formal + -- may be its specific type, or that of a descendent of it. elsif Is_Class_Wide_Type (T2) - and then Base_Type (Root_Type (T2)) = Base_Type (T1) + and then + (Class_Wide_Type (T1) = T2 + or else Base_Type (Root_Type (T2)) = Base_Type (T1)) then return True; diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index c73e7e36b8a..60aad672af9 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -2785,7 +2785,13 @@ package body Sprint is end if; Write_Indent; - Sprint_Node_Sloc (Specification (Node)); + + if Present (Corresponding_Spec (Node)) then + Sprint_Node_Sloc (Parent (Corresponding_Spec (Node))); + else + Sprint_Node_Sloc (Specification (Node)); + end if; + Write_Str (" is"); Sprint_Indented_List (Declarations (Node)); diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index ab213af14bb..17ea1e7fdce 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -245,7 +245,19 @@ package body Switch.C is when 'C' => Ptr := Ptr + 1; - CodePeer_Mode := True; + + if not CodePeer_Mode then + CodePeer_Mode := True; + + -- Suppress compiler warnings by default, since what we are + -- interested in here is what CodePeer can find out. Note + -- that if -gnatwxxx is specified after -gnatC on the + -- command line, we do not want to override this setting in + -- Adjust_Global_Switches, and assume that the user wants to + -- get both warnings from GNAT and CodePeer messages. + + Warning_Mode := Suppress; + end if; -- Processing for d switch |