aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2015-04-27Makefile-lan.in (ada.mostlyclean): Remove gnatbind and gnat1.Jim Wilson2-0/+6
ada/ * gcc-interface/Makefile-lan.in (ada.mostlyclean): Remove gnatbind and gnat1. cp/ * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus. fortran/ * Make-lang.in (fortran.mostlyclean): Remove gfortran and gfortran-cross. go/ * Make-lang.in (go.mostlyclean): Remove gccgo, gccgo-cross, and go1. jit/ * Make-lang.in (jit.mostlyclean): Remove shared libraries and object files. objc/ * Make-lang.in (objc.mostlyclean): Remove cc1obj. objcp/ * Make-lang.in (obj-c++.mostlyclean): Remove cc1objplus. From-SVN: r222492
2015-04-13* gnatvsn.ads (Library_Version): Bump to 6.Eric Botcazou2-1/+5
From-SVN: r222041
2015-04-09fix Ada bootstrap for powerpc-darwin (and several regressions in ACATS and gnat)Iain Sandoe2-1/+7
gcc/ada: * gcc-interface/Makefile.in (darwin, powerpc): Enable atomics. From-SVN: r221962
2015-04-08decl.c (gnat_to_gnu_entity): Do not make a function returning an ↵Eric Botcazou3-9/+22
unconstrained type 'const' for the middle-end. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: Do not make a function returning an unconstrained type 'const' for the middle-end. * gcc-interface/trans.c (Pragma_to_gnu) <case Pragma_Warning>: Use exact condition to detect Reason => "..." pattern. From-SVN: r221916
2015-03-31Fix bzero warning in child_setup_ttyTom de Vries2-2/+8
2015-03-31 Tom de Vries <tom@codesourcery.com> PR ada/65490 * terminals.c (child_setup_tty): Fix warning 'argument to sizeof in bzero call is the same expression as the destination'. From-SVN: r221789
2015-03-26* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Deref>: New case.Eric Botcazou2-0/+16
From-SVN: r221711
2015-03-24[multiple changes]Arnaud Charlet7-6/+48
2015-03-24 Gary Dismukes <dismukes@adacore.com> * sem_ch3.adb: Minor typo fix (missing paren). 2015-03-24 Robert Dewar <dewar@adacore.com> * sinfo.ads: Update comment. 2015-03-24 Robert Dewar <dewar@adacore.com> * exp_attr.adb: Add entry for typ'Deref. * sem_attr.adb (Deref): New GNAT attribute. * sem_attr.ads: Add entry for new GNAT attribute Deref. * snames.ads-tmpl: Add entries for new attribute Deref. From-SVN: r221630
2015-03-24[multiple changes]Arnaud Charlet3-1/+12
2015-03-24 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Rep_Item_Too_Early): allow pragma Convention on generic type. 2015-03-24 Gary Dismukes <dismukes@adacore.com> * inline.adb: Minor typo fix. From-SVN: r221629
2015-03-24building_executable_programs_with_gnat.rst, [...]: Doc improvements.Arnaud Charlet10-872/+959
* doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/gnat_utility_programs.rst doc/gnat_rm/implementation_defined_attributes.rst doc/gnat_rm/implementation_defined_pragmas.rst doc/gnat_rm/representation_clauses_and_pragmas.rst doc/gnat_rm/about_this_guide.rst doc/gnat_rm/implementation_of_ada_2012_features.rst: Doc improvements. * gnat_rm.texi, gnat_ugn.texi: Regenerate. From-SVN: r221628
2015-03-23re PR bootstrap/65522 (Svn revision 221590 fails bootstrap - ↵Jakub Jelinek2-2/+7
../libiberty/libiberty.a(cplus-dem.o): In function `ada_demangle': cplus-dem.c:(.text+0xdb8): multiple definition of `ada_demangle' ada/adadecode.o:adadecode.c:(.text+0x863): first defined here) PR bootstrap/65522 * ipa-devirt.c: Remove duplicate demangle.h include. * adadecode.c (ada_demangle): Guard with IN_RTS instead of IN_GCC. From-SVN: r221599
2015-03-20re PR ada/65451 (compiler crash on volatile access type)Eric Botcazou3-42/+25
PR ada/65451 * gcc-interface/utils.c (gnat_pushdecl): Tidy up and improve comment. Make sure to chain only main variants through TYPE_NEXT_PTR_TO. From-SVN: r221531
2015-03-16utils2.c (gnat_invariant_expr): Return null if the type of the expression ↵Eric Botcazou2-0/+11
ends up being composite. * gcc-interface/utils2.c (gnat_invariant_expr): Return null if the type of the expression ends up being composite. From-SVN: r221449
2015-03-16decl.c (is_from_limited_with_of_main): New predicate.Eric Botcazou3-12/+37
* gcc-interface/decl.c (is_from_limited_with_of_main): New predicate. (gnat_to_gnu_entity) <E_Subprogram_Type>: Invoke it on return and parameter types to detect circularities in ASIS mode. * gcc-interface/trans.c (Attribute_to_gnu): Mention AI05-0151. From-SVN: r221447
2015-03-16decl.c (gnat_to_gnu_entity): Do not short-circuit the regular handling.Eric Botcazou2-2/+9
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Abstract_State>: Do not short-circuit the regular handling. From-SVN: r221446
2015-03-13Fix typo.Arnaud Charlet1-1/+1
From-SVN: r221423
2015-03-13[multiple changes]Arnaud Charlet15-98/+563
2015-03-13 Robert Dewar <dewar@adacore.com> * exp_unst.adb (Note_Uplevel_Reference): Eliminate duplicate references. (Actual_Ref): New function. (AREC_String): Minor reformatting. (Unnest_Subprogram): Use Actual_Ref. * frontend.adb (Frontend): Turn off Unnest_Subprogram_Mode before call to Instantiate_Bodies. 2015-03-13 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Profile): If the return type of a function being frozen is an untagged limited view and the function is abstract, mark the type as frozen because there is no later point at which the profile of the subprogram will be elaborated. 2015-03-13 Robert Dewar <dewar@adacore.com> * einfo.adb, einfo.ads, atree.adb, atree.ads, atree.h: Add seventh component to entities. Add new fields Field36-41 and Node36-41. 2015-03-13 Claire Dross <dross@adacore.com> * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Rewrite after review. 2015-03-13 Robert Dewar <dewar@adacore.com> * exp_util.adb (Is_Volatile_Reference): Compile time known value is never considered to be a volatile reference. 2015-03-13 Robert Dewar <dewar@adacore.com> * sem_ch3.adb (Analyze_Object_Contract): Suppress "constant cannot be volatile" for internally generated object (such as FIRST and LAST constants). 2015-03-13 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Validate_Access_Subprogram_Instance): If a convention is specified for the formal parameter, verify that the actual has the same convention. * sem_prag.adb (Set_Convention_From_Pragma): Allow convention pragma to be set on a generic formal type. * sem_util.adb (Set_Convention): Ignore within an instance, as it has already been verified in the generic unit. From-SVN: r221422
2015-03-13[multiple changes]Arnaud Charlet12-42/+176
2015-03-13 Claire Dross <dross@adacore.com> * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline subprograms with unconstrained record parameters containing Itype declarations. * sinfo.ads Document GNATprove assumption that type should match in the AST. * sem_ch6.adb (Analyze_Subprogram_Body_Contract): Do not check for Refined_Depends and Refined_Globals contracts as they are optional. 2015-03-13 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Instantiate_Type): For a floating-point type, capture dimension info if any, because the generated subtype declaration does not come from source and will not process dimensions. * sem_dim,adb (Analyze_Dimension_Extension_Or_Record_Aggregate): Do not analyze expressions with an initialization procedure because aggregates will have been checked at the point of record declaration. 2015-03-13 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add entries for aspect Unimplemented. * einfo.ads, einfo.adb (Is_Unimplemented): New flag. * sem_ch13.adb: Add dummy entry for aspect Unimplemented. * snames.ads-tmpl: Add entry for Name_Unimplemented. From-SVN: r221420
2015-03-13[multiple changes]Arnaud Charlet4-14/+30
2015-03-13 Gary Dismukes <dismukes@adacore.com> * style.adb (Missing_Overriding): Apply the Comes_From_Source test to the Original_Node of the subprogram node, to handle the case of a null procedure declaration that has been rewritten as an empty procedure body. 2015-03-13 Robert Dewar <dewar@adacore.com> * exp_util.ads: Minor fix to comment. * sem_ch3.adb (Constrain_Index): Correct pasto from previous change. From-SVN: r221419
2015-03-13exp_util.ads, [...] (Force_Evaluation): Add Related_Id and Is_Low/High_Bound ↵Robert Dewar4-82/+54
params. 2015-03-13 Robert Dewar <dewar@adacore.com> * exp_util.ads, exp_util.adb (Force_Evaluation): Add Related_Id and Is_Low/High_Bound params. * sem_ch3.adb (Constrain_Index): Use new Force_Evaluation calling sequence to simplify generation of FIRST/LAST temps for bounds. From-SVN: r221418
2015-03-12Add missing bit to ChangeLog entry for the latest updateOlivier Hainque1-0/+1
in gcc/ada/gcc-interface/trans.c. From-SVN: r221392
2015-03-12trans.c (Attribute_to_gnu): On targets where a function symbol designates a ↵Olivier Hainque2-1/+34
function descriptor... 2015-03-12 Olivier Hainque <hainque@adacore.com> * gcc-interface/trans.c (Attribute_to_gnu) <Code_Address case>: On targets where a function symbol designates a function descriptor, fetch the function code address from the descriptor. From-SVN: r221391
2015-03-04[multiple changes]Arnaud Charlet5-23/+72
2015-03-04 Robert Dewar <dewar@adacore.com> * sem_warn.adb: Minor reformatting. * init.c: Minor tweaks. 2015-03-04 Dmitriy Anisimko <anisimko@adacore.com> * a-coinho-shared.adb: Fix clear of already empty holder. 2015-03-04 Robert Dewar <dewar@adacore.com> * exp_unst.adb (Check_Dynamic_Type): Ignore library level types. (Check_Uplevel_Reference_To_Type): Ignore call inside generic. (Note_Uplevel_Reference): Ignore call inside generic. (Note_Uplevel_Reference): Fix check for no entity field. (Unnest_Subprogram): Ignore call inside generic. (Find_Current_Subprogram): Use Defining_Entity, not Defining_Unit_Name. (Visit_Node): Ignore calls to Imported subprograms. (Visit_Node): Fix problem in finding subprogram body in some cases. (Add_Form_To_Spec): Use Defining_Entity, not Defining_Unit_Name. From-SVN: r221188
2015-03-04[multiple changes]Arnaud Charlet6-205/+178
2015-03-04 Robert Dewar <dewar@adacore.com> * einfo.adb (Is_ARECnF_Entity): Removed. (Last_Formal): Remove special handling of Is_ARECnF_Entity. (Next_Formal): Remove special handling of Is_ARECnF_Entity. (Next_Formal_With_Extras): Remove special handling of Is_ARECnF_Entity. (Number_Entries): Minor reformatting. * einfo.ads (Is_ARECnF_Entity): Removed. * exp_unst.adb (Unnest_Subprogram): Remove setting of Is_ARECnF_Entity. (Add_Extra_Formal): Use normal Extra_Formal circuit. * sprint.adb (Write_Param_Specs): Properly handle case where there are no source formals, but we have at least one Extra_Formal present. 2015-03-04 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Resolve_Record_Aggregate, Add_Discriminant_Values): If the value is a reference to the current instance of an enclosing type, use its base type to check against prefix of attribute reference, because the target type may be otherwise constrained. From-SVN: r221187
2015-03-04[multiple changes]Arnaud Charlet4-5/+57
2015-03-04 Robert Dewar <dewar@adacore.com> * atree.h: Add entries for Flag287-Flag309. * einfo.adb: Add (unused) flags Flag287-Flag309. 2015-03-04 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Collect_Interfaces, Collect): When gathering interfaces of ancestors, handle properly a subtype of a private extension. From-SVN: r221183
2015-03-04[multiple changes]Arnaud Charlet5-21/+138
2015-03-04 Robert Dewar <dewar@adacore.com> * einfo.adb (Is_ARECnF_Entity): New flag (ARECnF is an extra formal). (Next_Formal): Don't return ARECnF formal. (Last_Formal): Don't consider ARECnF formal. (Next_Formal_With_Extras): Do consider ARECnF formal. * einfo.ads (Is_ARECnF_Entity): New flag (ARECnF is an extra formal). * exp_unst.adb (Create_Entities): Set Is_ARECnF_Entity flag. 2015-03-04 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Expand_Simple_Function_Return): When the returned object is a class-wide interface object and we generate the accessibility described in RM 6.5(8/3) then displace the pointer to the object to reference the base of the object (to get access to the TSD of the object). From-SVN: r221182
2015-03-04[multiple changes]Arnaud Charlet11-47/+128
2015-03-04 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Abstract_State): Use routine Malformed_State_Error to issue general errors. (Analyze_Pragma): Diagnose a syntax error related to a state declaration with a simple option. (Malformed_State_Error): New routine. 2015-03-04 Robert Dewar <dewar@adacore.com> * a-strsup.adb (Super_Slice): Deal with super flat case. * einfo.ads: Minor reformatting. * s-imgdec.adb (Set_Decimal_Digits): Add comment about possibly redundant code. 2015-03-04 Claire Dross <dross@adacore.com> * a-cfdlli.ads, a-cfhase.ads, a-cforma.ads, a-cfhama.ads, a-cforse.ads, a-cofove.ads: Use Default_Initial_Condition on formal containers. From-SVN: r221180
2015-03-04Fix permission.Arnaud Charlet1-0/+0
From-SVN: r221179
2015-03-04[multiple changes]Arnaud Charlet3-14/+44
2015-03-04 Ed Schonberg <schonberg@adacore.com> * sem_warn.adb (Check_References): When checking for an unused in-out parameter of a class- wide type, use its type to determine whether it is private, in order to avoid a spurious warning when subprogram spec and body are in different units. 2015-03-04 Yannick Moy <moy@adacore.com> * sem_attr.adb: Improve warning messages. From-SVN: r221178
2015-03-04exp_ch6.adb (Expand_N_Subprogram_Body): Avoid trying to unnest generic ↵Robert Dewar6-144/+272
subprograms. 2015-03-04 Robert Dewar <dewar@adacore.com> * exp_ch6.adb (Expand_N_Subprogram_Body): Avoid trying to unnest generic subprograms. * exp_unst.adb (Check_Dynamic_Type): Handle record types properly (Note_Uplevel_Reference): Ignore uplevel references to non-types (Get_Level): Consider only subprograms, not blocks. (Visit_Node): Set proper condition for generating ARECnF entity. Ignore indirect calls. Ignore calls to subprograms outside our nest. (Unnest_Subprogram): Minor changes in dealing with ARECnF entity. (Add_Form_To_Spec): Properly set Last_Entity field. (Unnest_Subprogram): Set current subprogram scope for analyze calls. Handle case of no uplevel refs in outer subprogram Don't mark uplevel entities as aliased. Don't deal with calls with no ARECnF requirement. 2015-03-04 Robert Dewar <dewar@adacore.com> * s-valrea.adb (Scan_Real): Remove redundant tests from scaling loops. * s-imgdec.adb (Set_Decimal_Digits): Remove redundant Max operation in computing LZ. * sem_attr.adb: Minor typo fix From-SVN: r221177
2015-03-04[multiple changes]Arnaud Charlet8-540/+509
2015-03-04 Robert Dewar <dewar@adacore.com> * exp_ch7.adb: Minor reformatting. * exp_unst.adb (Build_Tables): Fix minor glitch for no separate spec case. * erroutc.adb (Delete_Msg): add missing decrement of info msg counter. 2015-03-04 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Build_Pragma_Check_Equivalent): Suppress references to formal parameters subject to pragma Unreferenced. (Suppress_Reference): New routine. * sem_attr.adb (Analyze_Attribute): Reimplement the analysis of attribute 'Old. Attributes 'Old and 'Result now share common processing. (Analyze_Old_Result_Attribute): New routine. (Check_Placement_In_Check): Removed. (Check_Placement_In_Contract_Cases): Removed. (Check_Placement_In_Test_Case): Removed. (Check_Use_In_Contract_Cases): Removed. (Check_Use_In_Test_Case): Removed. (In_Refined_Post): Removed. (Is_Within): Removed. * sem_warn.adb (Check_Low_Bound_Tested): Code cleanup. (Check_Low_Bound_Tested_For): New routine. 2015-03-04 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch3.adb (Expand_N_Object_Declaration): Generate a runtime check to test the expression of pragma Default_Initial_Condition when the object is default initialized. From-SVN: r221176
2015-03-02[multiple changes]Arnaud Charlet5-7/+72
2015-03-02 Robert Dewar <dewar@adacore.com> * scng.adb (Scan): Ignore illegal character in relaxed semantics mode. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Set_Membership); Retain Overloaded flag on left operand, so it can be properly resolved with type of alternatives of right operand. * sem_res.adb (Resolve_Set_Membership): Handle properly an overloaded left-hand side when the alternatives on the right hand side are literals of some universal type. Use first non-overloaded alternative to find expected type. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * exp_ch7.adb (Make_Set_Finalize_Address_Call): Use underlying type to retrieve designated type, because the purported access type may be a partial (private) view, when it is declared in the private part of a nested package, and finalization actions are generated when completing compilation of enclosing unit. From-SVN: r221116
2015-03-02back_end.adb (Call_Back_End): Remove previous patch...Robert Dewar8-209/+583
2015-03-02 Robert Dewar <dewar@adacore.com> * back_end.adb (Call_Back_End): Remove previous patch, the back end now gets to see the result of -gnatd.1 (Unnest_Subprogram_Mode) processing. * elists.ads, elists.adb (List_Length): New function. * exp_unst.ads, exp_unst.adb: Major changes, first complete version. * sem_util.adb (Check_Nested_Access): Handle formals in Unnest_Subprogram_Mode. (Adjust_Named_Associations): Minor reformatting. * sprint.adb (Sprint_Node_Actual): Fix failure to print aliased for parameters. From-SVN: r221115
2015-03-02[multiple changes]Arnaud Charlet11-170/+633
2015-03-02 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb (Uint24): New function (Set_Uint24): New procedure. * atree.h (Uint24): New macro for field access. * back_end.adb (Call_Back_End): For now, don't call back end if unnesting subprogs. * einfo.adb (Activation_Record_Component): New field (Subps_Index): New field. * einfo.ads (Activation_Record_Component): New field (Subps_Index): New field Minor reordering of comments into alpha order. * exp_unst.ads, exp_unst.adb: Continued development. 2015-03-02 Gary Dismukes <dismukes@adacore.com> * exp_disp.ads: Minor reformatting. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Chain_Use_Clause): Do not chain use clause from ancestor to list of use clauses active in descendant unit if we are within the private part of an intervening parent, to prevent circularities in use clause list. From-SVN: r221114
2015-03-02exp_ch9.adb (Build_Corresponding_Record): Propagate type invariants to the ↵Javier Miranda11-42/+223
corresponding record type. 2015-03-02 Javier Miranda <miranda@adacore.com> * exp_ch9.adb (Build_Corresponding_Record): Propagate type invariants to the corresponding record type. * exp_disp.ad[sb] (Set_DT_Position_Value): New subprogram which sets the value of the DTC_Entity associated with a given primitive of a tagged type and propagates the value to the wrapped subprogram. (Set_DTC_Entity_Value): Propagate the DTC value to the wrapped entity. * sem_ch13.adb (Build_Invariant_Procedure): Append the code associated with invariants of progenitors. * sem_ch3.adb (Build_Derived_Record_Type): Inherit type invariants of parents and progenitors. (Process_Full_View): Check hidden inheritance of class-wide type invariants. * sem_ch7.adb (Analyze_Package_Specification): Do not generate the invariant procedure for interface types; build the invariant procedure for tagged types inheriting invariants from their progenitors. * sem_prag.adb (Pragma_Invariant) Allow invariants in interface types but do not build their invariant procedure since their invariants will be propagated to the invariant procedure of types covering the interface. * exp_ch6.adb, exp_disp.adb, sem_ch3.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb: Replace all calls to Set_DT_Position by calls to Set_DT_Position_Value. From-SVN: r221113
2015-03-02sem_attr.adb (Analyze_Attribute): Factor out heavily indented code in ↵Hristian Kirtchev3-140/+186
Denote_Same_Function. 2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Factor out heavily indented code in Denote_Same_Function. Do not analyze attribute 'Result when it is inside procedure _Postconditions. Remove a misplaced warning diagnostic. Code cleanup. (Denote_Same_Function): New routine. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Code cleanup. Warn on pre/postconditions on an inlined subprogram. (Analyze_Pragma, Refined_Post case): Warn on pre/postconditions on an inlined subprogram. (Analyze_Pre_Post_Condition_In_Decl_Part): Code cleanup. Warn on pre/post condition on an inlined subprogram. (Analyze_Test_Case_In_Decl_Part): Code cleanup. Warn on pre/postconditions on an inlined subprogram. (Check_Postcondition_Use_In_Inlined_Subprogram): New routine. From-SVN: r221112
2015-03-02[multiple changes]Arnaud Charlet7-64/+113
2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Ensure_Aggregate_Form): Ensure that the name denoted by the Chars of a pragma argument association has the proper Sloc when converted into an aggregate. 2015-03-02 Bob Duff <duff@adacore.com> * sem_ch6.adb (Check_Private_Overriding): Capture Incomplete_Or_Partial_View in a constant. This is cleaner and more efficient. 2015-03-02 Gary Dismukes <dismukes@adacore.com> * einfo.ads, exp_unst.ads: Minor reformatting. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * a-strsea.adb (Find_Token): Ensure that the range of iteration does not perform any improper character access. This prevents erroneous access in the unusual case of an empty string target and a From parameter less than Source'First. 2015-03-02 Robert Dewar <dewar@adacore.com> * elists.adb (List_Length): Fix incorrect result. From-SVN: r221111
2015-03-02sem_ch6.adb (Check_Private_Overriding): Refine the legality checks here.Bob Duff2-2/+66
2015-03-02 Bob Duff <duff@adacore.com> * sem_ch6.adb (Check_Private_Overriding): Refine the legality checks here. It used to check that the function is merely overriding SOMEthing. Now it checks that the function is overriding a corresponding public operation. This is a correction to the implementation of the rule in RM-3.9.3(10). From-SVN: r221110
2015-03-02debug.adb: Document new debug flag -gnatd.1.Robert Dewar19-58/+1454
2015-03-02 Robert Dewar <dewar@adacore.com> * debug.adb: Document new debug flag -gnatd.1. * einfo.ads, einfo.adb (Has_Nested_Subprogram): New flag. (Has_Uplevel_Reference): New flag (Is_Static_Type): New flag. (Uplevel_Reference_Noted):New flag (Uplevel_References): New field. * elists.ads elists.adb (List_Length): New function. * exp_ch6.adb (Expand_N_Subprogram_Body): Call Unnest_Subprogram when appropriate (Process_Preconditions): Minor code reorganization and reformatting * exp_unst.ads, exp_unst.adb: New files. * gnat1drv.adb (Adjust_Global_Switches): Set Unnest_Subprogram_Mode if -gnatd.1 * namet.ads, namet.adb (Name_Find_Str): New version of Name_Find with string argument. * opt.ads (Unnest_Subprogram_Mode): New flag. * par-ch3.adb (P_Identifier_Declarations): Fixes to -gnatd.2 handling. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set Has_Nested_Subprogram flag. * sem_ch8.adb (Find_Direct_Name): New calling sequence for Check_Nested_Access. (Find_Selected_Component): Minor comment addition. * sem_util.adb (Check_Nested_Access): New version for use with Exp_Unst. (Note_Possible_Modification): New calling sequence for Check_Nested_Access. * sem_util.ads (Check_Nested_Access): New version for use with Exp_Unst. * gcc-interface/Make-lang.in (GNAT1_OBJS): Add exp_unst.o From-SVN: r221109
2015-03-02utils.c (gnat_pushdecl): For non-artificial pointer types...Pierre-Marie de Rodat3-30/+66
2015-03-02 Pierre-Marie de Rodat <derodat@adacore.com> * gcc-interface/utils.c (gnat_pushdecl): For non-artificial pointer types, preserve the original type and create copies just like the C front-end does. For artificial ones, do not define a name for the original type. (create_type_decl): When gnat_pushdecl made the input type the original type for the new declaration, do not define a stub declaration for it. * gcc-interface/utils2.c (build_binary_op): Accept two different pointer types when they point to the same type. From-SVN: r221108
2015-03-02exp_util.adb (Possible_Bit_Aligned_Component): Do not process an unanalyzed ↵Hristian Kirtchev3-11/+38
node. 2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Possible_Bit_Aligned_Component): Do not process an unanalyzed node. * sem_util.adb (Kill_Current_Values): Do not invalidate and de-null a constant. From-SVN: r221107
2015-03-02[multiple changes]Arnaud Charlet12-71/+64
2015-03-02 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, exp_attr.adb, checks.adb, exp_aggr.adb: Minor reformatting. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb: extend use of Available_Subtype. 2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Duplication_Error): Remove the special handling of 'Class or _Class in the context of pre/postconditions. (Process_Class_Wide_Condition): Remove the special handling of 'Class or _Class in the context of pre/postconditions. * sem_util.adb (Original_Aspect_Pragma_Name): Names Pre_Class and Post_Class no longer need to be converted to _Pre and _Post. * sem_util.ads (Original_Aspect_Pragma_Name): Update the comment on usage. 2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Process_Preconditions): Modify the mechanism that find the first source declaration to correct exit the loop once it has been found. 2015-03-02 Gary Dismukes <dismukes@adacore.com> * a-strsea.adb: Minor typo fix. 2015-03-02 Bob Duff <duff@adacore.com> * einfo.ads: Minor comment fixes. From-SVN: r221103
2015-03-02[multiple changes]Arnaud Charlet4-10/+29
2015-03-02 Gary Dismukes <dismukes@adacore.com> * einfo.adb, checks.adb: Minor reformatting and typo fixes. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Get_Assoc_Expr): If the Default_Component_Value is defined for the array type, use it instead of a Default_Value specified for the component type itself. From-SVN: r221102
2015-03-02[multiple changes]Arnaud Charlet25-2985/+3511
2015-03-02 Thomas Quinot <quinot@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case Input): When expanding a 'Input attribute reference for a class-wide type, do not generate a separate object declaration for the controlling tag dummy object; instead, generate the expression inline in the dispatching call. Otherwise, the declaration (which involves a call to String'Input, returning a dynamically sized value on the secondary stack) will be expanded outside of proper secondary stack mark/release operations, and will thus cause a secondary stack leak. 2015-03-02 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Add_Validity_Check): Change the names of all formal parameters to better illustrate their purpose. Update the subprogram documentation. Update all occurrences of the formal parameters. Generate a pre/postcondition pragma by calling Build_Pre_Post_Condition. (Build_PPC_Pragma): Removed. (Build_Pre_Post_Condition): New routine. * einfo.adb Node8 is no longer used as Postcondition_Proc. Node14 is now used as Postconditions_Proc. Flag240 is now renamed to Has_Expanded_Contract. (First_Formal): The routine can now operate on generic subprograms. (First_Formal_With_Extras): The routine can now operate on generic subprograms. (Has_Expanded_Contract): New routine. (Has_Postconditions): Removed. (Postcondition_Proc): Removed. (Postconditions_Proc): New routine. (Set_Has_Expanded_Contract): New routine. (Set_Has_Postconditions): Removed. (Set_Postcondition_Proc): Removed. (Set_Postconditions_Proc): New routine. (Write_Entity_Flags): Remove the output of Has_Postconditions. Add the output of Has_Expanded_Contract. (Write_Field8_Name): Remove the output of Postcondition_Proc. (Write_Field14_Name): Add the output of Postconditions_Proc. * einfo.ads New attributes Has_Expanded_Contract and Postconditions_Proc along with occurrences in entities. Remove attributes Has_Postconditions and Postcondition_Proc along with occurrences in entities. (Has_Expanded_Contract): New routine along with pragma Inline. (Has_Postconditions): Removed along with pragma Inline. (Postcondition_Proc): Removed along with pragma Inline. (Postconditions_Proc): New routine along with pragma Inline. (Set_Has_Expanded_Contract): New routine along with pragma Inline. (Set_Has_Postconditions): Removed along with pragma Inline. (Set_Postcondition_Proc): Removed along with pragma Inline. (Set_Postconditions_Proc): New routine along with pragma Inline. * exp_ch6.adb (Add_Return): Code cleanup. Update the generation of the call to the _Postconditions routine of the procedure. (Expand_Non_Function_Return): Reformat the comment on usage. Code cleanup. Update the generation of the call to the _Postconditions routine of the procedure or entry [family]. (Expand_Simple_Function_Return): Update the generation of the _Postconditions routine of the function. (Expand_Subprogram_Contract): Reimplemented. * exp_ch6.ads (Expand_Subprogram_Contract): Update the parameter profile along the comment on usage. * exp_ch9.adb (Build_PPC_Wrapper): Code cleanup. (Expand_N_Task_Type_Declaration): Generate pre/postconditions wrapper when the entry [family] has a contract with pre/postconditions. * exp_prag.adb (Expand_Attributes_In_Consequence): New routine. (Expand_Contract_Cases): This routine and its subsidiaries now analyze all generated code. (Expand_Old_In_Consequence): Removed. * sem_attr.adb Add with and use clause for Sem_Prag. (Analyze_Attribute): Reimplment the analysis of attribute 'Result. (Check_Use_In_Test_Case): Use routine Test_Case_Arg to obtain "Ensures". * sem_ch3.adb (Analyze_Declarations): Analyze the contract of a generic subprogram. (Analyze_Object_Declaration): Do not create a contract node. (Derive_Subprogram): Do not create a contract node. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Do not create a contract node. (Analyze_Completion_Contract): New routine. (Analyze_Function_Return): Alphabetize. (Analyze_Generic_Subprogram_Body): Alphabetize. Do not create a contract node. Do not copy pre/postconditions to the original generic template. (Analyze_Null_Procedure): Do not create a contract node. (Analyze_Subprogram_Body_Contract): Reimplemented. (Analyze_Subprogram_Body_Helper): Do not mark the enclosing scope as having postconditions. Do not create a contract node. Analyze the subprogram body contract of a body that acts as a compilation unit. Expand the subprogram contract after the declarations have been analyzed. (Analyze_Subprogram_Contract): Reimplemented. (Analyze_Subprogram_Specification): Do not create a contract node. (List_Inherited_Pre_Post_Aspects): Code cleanup. * sem_ch6.adb (Analyze_Subprogram_Body_Contract): Update the comment on usage. (Analyze_Subprogram_Contract): Update the parameter profile and the comment on usage. * sem_ch7.adb (Analyze_Package_Body_Helper): Do not create a contract node. (Analyze_Package_Declaration): Do not create a contract node. (Is_Subp_Or_Const_Ref): Ensure that the prefix has an entity. * sem_ch8.adb (Analyze_Subprogram_Renaming): Do not create a contract node. * sem_ch9.adb (Analyze_Entry_Declaration): Do not create a contract node. * sem_ch10.adb (Analyze_Compilation_Unit): Move local variables to their proper section and alphabetize them. Analyze the contract of a [generic] subprogram after all Pragmas_After have been analyzed. (Analyze_Subprogram_Body_Stub_Contract): Alphabetize. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Do not create a contract node. (Analyze_Generic_Subprogram_Declaration): Alphabetize local variables. Do not create a contract node. Do not generate aspects out of pragmas for ASIS. (Analyze_Subprogram_Instantiation): Instantiate the contract of the subprogram. Do not create a contract node. (Instantiate_Contract): New routine. (Instantiate_Subprogram_Body): Alphabetize local variables. (Save_Global_References_In_Aspects): New routine. (Save_References): Do not save the global references found within the aspects of a generic subprogram. * sem_ch12.ads (Save_Global_References_In_Aspects): New routine. * sem_ch13.adb (Analyze_Aspect_Specifications): Do not use Original_Node for establishing linkages. (Insert_Pragma): Insertion in a subprogram body takes precedence over the case where the subprogram body is also a compilation unit. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Use Get_Argument to obtain the proper expression. Install the generic formals when the related context is a generic subprogram. (Analyze_Depends_In_Decl_Part): Use Get_Argument to obtain the proper expression. Use Corresponding_Spec_Of to obtain the spec. Install the generic formal when the related context is a generic subprogram. (Analyze_Global_In_Decl_Part): Use Get_Argument to obtain the proper expression. Use Corresponding_Spec_Of to obtain the spec. Install the generic formal when the related context is a generic subprogram. (Analyze_Initial_Condition_In_Decl_Part): Use Get_Argument to obtain the proper expression. Remove the call to Check_SPARK_Aspect_For_ASIS as the analysis is now done automatically. (Analyze_Pragma): Update all occurrences to Original_Aspect_Name. Pragmas Contract_Cases, Depends, Extensions_Visible, Global, Postcondition, Precondition and Test_Case now carry generic templates when the related context is a generic subprogram. The same pragmas are no longer forcefully fully analyzed when the context is a subprogram that acts as a compilation unit. Pragmas Abstract_State, Initial_Condition, Initializes and Refined_State have been clean up. Pragmas Post, Post_Class, Postcondition, Pre, Pre_Class and Precondition now use the same routine for analysis. Pragma Refined_Post does not need to check the use of 'Result or the lack of a post-state in its expression. Reimplement the analysis of pragma Test_Case. (Analyze_Pre_Post_Condition): New routine. (Analyze_Pre_Post_Condition_In_Decl_Part): Reimplemented. (Analyze_Refined_Depends_In_Decl_Part): Use Get_Argument to obtain the proper expression. (Analyze_Refined_Global_In_Decl_Part): Use Get_Argument to obtain the proper expression. (Analyze_Test_Case_In_Decl_Part): Reimplemented. (Check_Pre_Post): Removed. (Check_Precondition_Postcondition): Removed. (Check_SPARK_Aspect_For_ASIS): Removed. (Check_Test_Case): Removed. (Collect_Subprogram_Inputs_Outputs): Use Get_Argument to obtain the proper expression. Use Corresponding_Spec_Of to find the proper spec. (Create_Generic_Template): New routine. (Duplication_Error): New routine. (Expression_Function_Error): New routine. (Find_Related_Subprogram_Or_Body): Moved to the spec of Sem_Prag. Emit precise error messages. Account for cases of rewritten expression functions, generic instantiations, handled sequence of statements and pragmas from aspects. (Get_Argument): New routine. (Make_Aspect_For_PPC_In_Gen_Sub_Decl): Removed. (Preanalyze_CTC_Args): Removed. (Process_Class_Wide_Condition): New routine. * sem_prag.ads (Analyze_Test_Case_In_Decl_Part): Update the parameter profile along with the comment on usage. (Find_Related_Subprogram_Or_Body): Moved from the body of Sem_Prag. (Make_Aspect_For_PPC_In_Gen_Sub_Decl): Removed. (Test_Case_Arg): New routine. * sem_util.adb Add with and use clauses for Sem_Ch6. (Add_Contract_Item): This routine now creates a contract node the first time an item is added. Remove the duplicate aspect/pragma checks. (Check_Result_And_Post_State): Reimplemented. (Corresponding_Spec_Of): New routine. (Get_Ensures_From_CTC_Pragma): Removed. (Get_Requires_From_CTC_Pragma): Removed. (Has_Significant_Contract): New routine. (Inherit_Subprogram_Contract): Inherit only if the source has a contract. (Install_Generic_Formals): New routine. (Original_Aspect_Name): Removed. (Original_Aspect_Pragma_Name): New routine. * sem_util.ads (Check_Result_And_Post_State): Reimplemented. (Corresponding_Spec_Of): New routine. (Get_Ensures_From_CTC_Pragma): Removed. (Get_Requires_From_CTC_Pragma): Removed. (Has_Significant_Contract): New routine. (Install_Generic_Formals): New routine. (Original_Aspect_Name): Removed. (Original_Aspect_Pragma_Name): New routine. * sem_warn.adb Add with and use clauses for Sem_Prag. (Within_Postcondition): Use Test_Case_Arg to extract "Ensures". From-SVN: r221101
2015-03-02sem_ch8.adb (Available_Subtype): Optimization in Find_Selected_Component...Ed Schonberg2-1/+47
2015-03-02 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Available_Subtype): Optimization in Find_Selected_Component: when safe, use existing subtype of array component, possibly discriminant-dependent, rather than creating new subtype declaration for it. In this fashion different occurrences of the component have the same subtype, rather than just equivalent ones. Simplifies value tracing in GNATProve. From-SVN: r221100
2015-03-01re PR ada/65259 (Failure to build Ada DVI and PDF documentation)Arnaud Charlet4-54/+56
PR ada/65259 * doc/gnat_ugn/gnat_project_manager.rst, doc/gnat_ugn/platform_specific_information.rst: Remove reference to image, too troublesome with texi format. * gnat_ugn.texi: Regenerate. From-SVN: r221087
2015-02-25Minor fixEric Botcazou1-2/+2
From-SVN: r220959
2015-02-24[PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter.Thomas Schwinge2-19/+23
Fixup for r219836: adjust builtin function prototypes. PR libgomp/64625 gcc/ * omp-builtins.def (BUILT_IN_GOACC_DATA_START): Specify as BT_FN_VOID_INT_SIZE_PTR_PTR_PTR, not BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR. (BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_UPDATE): Specify as BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_INT_INT_VAR, not BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR. (BUILT_IN_GOACC_PARALLEL): Specify as BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR, not BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR. * builtin-types.def (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR) (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR): Remove function types. (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR) (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_INT_INT_VAR) (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR): New function types. gcc/ada/ * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_8) (DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. gcc/c-family/ * c-common.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. gcc/fortran/ * f95-lang.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. * types.def (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR) (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR): Remove function types. (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR) (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_INT_INT_VAR) (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR): New function types. gcc/jit/ * jit-builtins.c (DEF_FUNCTION_TYPE_VAR_8) (DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. * jit-builtins.h (DEF_FUNCTION_TYPE_VAR_8) (DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. gcc/lto/ * lto-lang.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12): Remove macros. (DEF_FUNCTION_TYPE_VAR_7, DEF_FUNCTION_TYPE_VAR_11): New macros. From-SVN: r220944
2015-02-24Minor fixEric Botcazou1-2/+3
From-SVN: r220936
2015-02-23Fix number of arguments parameter in Ada DEF_FUNCTION_TYPE_*.Thomas Schwinge2-2/+7
gcc/ada/ * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_8) (DEF_FUNCTION_TYPE_VAR_12): Fix number of arguments parameter. From-SVN: r220910
2015-02-22Makefile: postprocess texinfo files to update @dircategory and update texi ↵Arnaud Charlet4-7/+14
files under... * doc/Makefile: postprocess texinfo files to update @dircategory and update texi files under gcc/ada. * gnat_ugn.texi, gnat_rm.texi: Regenerated. From-SVN: r220898