aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2019-12-13[Ada] Avoid spurious errors on Global/Depends in instantiationsYannick Moy2-35/+35
2019-12-13 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Depends_In_Decl_Part, Analyze_Global_In_Decl_Part, Analyze_Refined_Depends_In_Decl_Part, Analyze_Refined_Global_In_Decl_Part, Check_Missing_Part_Of): Skip redundant checking involving visibility inside instantiations. From-SVN: r279348
2019-12-13[Ada] Prevent inlining inside condition of while loop in GNATproveYannick Moy4-0/+42
2019-12-13 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Call): Prevent inlining inside while loop conditions. * sem_util.adb, sem_util.ads (In_While_Loop_Condition): New query function. From-SVN: r279347
2019-12-13[Ada] Ada2020: Update Impunit for Ada 202XBob Duff5-30/+69
2019-12-13 Bob Duff <duff@adacore.com> gcc/ada/ * impunit.ads: Add Ada_202X_Unit. * impunit.adb: Add a table Non_Imp_File_Names_2X analogous to the other tables. Add code to search this table. * opt.ads: Add Warn_On_Ada_202X_Compatibility flag, currently always True. * sem_ch10.adb (Analyze_With_Clause): Give a warning if an Ada 2020 unit is with-ed when Ada_Version < Ada_2020. Change 'if' to 'case': Full coverage rules rule. From-SVN: r279346
2019-12-13[Ada] Rtsfind: minor comment fixesBob Duff2-60/+15
2019-12-13 Bob Duff <duff@adacore.com> gcc/ada/ * rtsfind.ads: Minor comment fix. From-SVN: r279345
2019-12-13[Ada] Up-level addressing problems with private tasks and selective accept procsGary Dismukes2-4/+13
2019-12-13 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * sem_util.adb (Scope_Within): For the case of checking for a task type procedure, check the Implementation_Base_Type of Curr. (Scope_Within_Or_Same): For the case of checking for a task type procedure, check the Implementation_Base_Type of Curr. From-SVN: r279344
2019-12-13[Ada] Add Ada.Containers.Vectors.Generic_Parallel_Sorting to known unitsArnaud Charlet2-1/+8
2019-12-13 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * impunit.adb (Non_Imp_File_Names_12): Add Ada.Containers.Vectors.Generic_Parallel_Sorting. From-SVN: r279343
2019-12-13[Ada] Missing accessibility checks on conditionalsJustin Squirek3-4/+89
2019-12-13 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Allocator): Add calls to Check_Cond_Expr_Accessibility when a conditional expression is found. (Check_Allocator_Discrim_Accessibility_Exprs): Created to recursively traverse a potentially compound conditional expression and perform accessibility checks for each alternative. * sem_util.adb (Dynamic_Accessibility_Level): Avoid use of original node of the expression in question so we can handle dynamic accessibility in the limited case of a constant folded conditional expression. From-SVN: r279342
2019-12-13[Ada] Implement AI12-0101Steve Baird2-36/+115
2019-12-13 Steve Baird <baird@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Op_Eq.Is_Equality): Move this function from within Expand_N_Op_Eq.Find_Equality out to immediately within Expand_N_Op_Eq in order to give it greater visibility. Add a new Typ parameter (defaulted to Empty) which, if non-empty, means the function will return False in the case of an equality op for some other type. * (Expand_N_Op_Eq.User_Defined_Primitive_Equality_Op): A new function. Given an untagged record type, finds the corresponding user-defined primitive equality op (if any). May return Empty. Ignores visibility. * (Expand_N_Op): For Ada2012 or later, check for presence of a user-defined primitive equality op before falling back on the usual predefined component-by-component comparison. If found, then call the user-defined op instead. From-SVN: r279341
2019-12-13[Ada] Spurious error on overriding controlled primitiveJustin Squirek2-6/+31
2019-12-13 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch6.adb (Check_Overriding_Indicator): Modify condition to take into account the modification of the Is_Hidden flag within generic instances. (Verify_Overriding_Indicator): Add an exception for controlled primitives within an instance. From-SVN: r279340
2019-12-13[Ada] New flag to indicate whether aspect appears on partial viewEd Schonberg4-0/+49
2019-12-13 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sinfo.ads, sinfo.adb (Aspect_On_Partial_View, Set_Aspect_On_Partial_View): New flag for use by SPARK, to indicate whether an aspect that appears on a type declaration applies to the partial view of that type. * sem_ch13.adb (Analyze_Aspect_Specification): Set new flag appropriately. From-SVN: r279339
2019-12-12[Ada] Spurious warning about change of representastion in callEd Schonberg2-0/+15
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch13.adb (Same_Reprewentation): if the actual in a call is a generic actual type, use its bsae type to determine whether a change of representastion may be necessary for proper parameter passing. From-SVN: r279305
2019-12-12[Ada] Spurious error on universal access equality operatorEd Schonberg2-2/+10
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_type.adb (Find_Unique_Type): A call to the universal access equality operator requires one operand to be a universal access, and the other to be an access type. There is no requirement, as previously implied by this routine, that pool-specific access types were illegal in this context. From-SVN: r279304
2019-12-12[Ada] Tighten up semantic checking for protected subprogram declarationsSteve Baird2-13/+62
2019-12-12 Steve Baird <baird@adacore.com> gcc/ada/ * sem_ch6.adb (New_Overloaded_Entity.Check_Conforming_Paramters): Add new Conformance_Type parameter. With the value of Subtype_Conformant, the behavior of Check_Conforming_Parameters is unchanged. The call in Matching_Entry_Or_Subprogram to instead passes in Type_Conformant. This corresponds to the use of "type conformant" in Ada RM 9.4(11.4/3). (New_Overloaded_Entity.Has_Matching_Entry_Or_Subprogram): Add new Normalized_First_Parameter_Type function to help in ignoring the distinction between protected and access-to-protected first parameters when checking prefixed-view profile matching. Replace computations of the type of the first parameter with calls to this function as appropriate. From-SVN: r279303
2019-12-12[Ada] Missing dereference in bound of slice in element iteratorEd Schonberg2-0/+30
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch5.adb: (Analyze_Iterator_Specification): If the iteration is over a slice, complete the resolution of its bounds, which may be aebitrary expressions. The previous pre-analysis may have created itypes for the slice but has not performed the expansion that for example may introduce actions that specify explicit dereferences and run-time checks. From-SVN: r279302
2019-12-12[Ada] Improve error message for dispatching subprogram formalsEd Schonberg2-3/+13
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch8.adb: Improve error message for dispatching subprogram formals. From-SVN: r279301
2019-12-12[Ada] Fix related to handling up-level references in protected entriesGary Dismukes2-1/+9
2019-12-12 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_ch9.adb (Build_Protected_Entry): Set the Scope of the new block to be the entity of the procedure created for the entry. From-SVN: r279300
2019-12-12[Ada] Improved handling of circular compilation dependenciesSteve Baird2-0/+21
2019-12-12 Steve Baird <baird@adacore.com> gcc/ada/ * sem_ch10.adb (Install_With_Clause): Check for the case of a circular dependency involving a predefined (or GNAT-defined) unit and handle that case by generating an appropropriate error message. From-SVN: r279299
2019-12-12[Ada] Fix various typos, plus minor reformattingGary Dismukes3-6/+10
2019-12-12 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * sem_ch4.adb, sem_res.adb: Minor reformatting. From-SVN: r279298
2019-12-12[Ada] Broken privacy on Controlled type extensionsJustin Squirek2-2/+57
2019-12-12 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch4.adb (Analyze_One_Call): Add condition to check for incorrectly resolved hidden controlled primitives. From-SVN: r279297
2019-12-12[Ada] Fix processing of standard predefined operatorsEd Schonberg2-1/+9
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_res.adb: Fix processing of standard predefined operators. From-SVN: r279296
2019-12-12[Ada] Fix Global contract for the predefined Yield procedurePiotr Trojanek2-1/+7
2019-12-12 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * libgnarl/a-dispat.ads (Yield): Update Global contract. From-SVN: r279295
2019-12-12[Ada] Fix repeated words and typos in doc and commentsPiotr Trojanek19-40/+60
2019-12-12 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * libgnat/g-altive.ads: Fix typo in comment. * bindo-graphs.adb: Fix repeated words in comment. * exp_ch4.adb: Likewise. * exp_ch5.adb: Likewise. * exp_ch7.adb: Likewise. * exp_pakd.adb: Likewise. * exp_unst.adb: Likewise. * exp_util.adb: Likewise. * freeze.adb: Likewise. * inline.adb: Likewise. * layout.adb: Likewise. * sem_ch12.adb: Likewise. * sem_ch13.adb: Likewise. * sem_ch4.adb: Likewise. * sem_ch9.adb: Likewise. * sem_elab.adb: Likewise. * doc/gnat_ugn/gnat_and_program_execution.rst: Fix repeated words in user documentation. * gnat_ugn.texi: Regenerate. From-SVN: r279294
2019-12-12[Ada] Fix wrong value of 'Size for slices of bit-packed arrays (2)Eric Botcazou3-7/+16
2019-12-12 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_Size_Attribute): Look directly at the prefix to detect the bit-packed slices. Apply the checks last in case the attribute needs to be processed by the back-end. * exp_ch4.adb (Expand_N_Slice): Do not create a temporary for a prefix of the Size attribute. From-SVN: r279293
2019-12-12[Ada] Implement AI12-0036 (a new legality check for instantiations)Steve Baird2-0/+35
2019-12-12 Steve Baird <baird@adacore.com> gcc/ada/ * sem_ch12.adb (Instantiate_Type.Validate_Derived_Type_Instance): Implement the legality check of AI12-0036 From-SVN: r279292
2019-12-12[Ada] Spurious visibility error on subunit with optimizationEd Schonberg2-0/+14
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch10.adb (Analyze_Subunit): Fix spurious visibility error on subunit with optimization. From-SVN: r279291
2019-12-12[Ada] Define __gnat_personality_v0 for SEHArnaud Charlet2-0/+17
2019-12-12 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * raise-gcc.c (__gnat_personality_v0): Define for SEH. From-SVN: r279290
2019-12-12[Ada] Handling up-level references in protected entries and freeze nodesGary Dismukes2-0/+42
2019-12-12 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_ch9.adb (Build_Protected_Entry): Analyze the block created to hold the declarations and statements of the protected entry body right after it's created, and then call Reset_Scopes_To on that block to reset the Scope of nested entities to the block scope. (Reset_Scope): Add handling for N_Freeze_Entity nodes, calling Reset_Scopes recursively on the Actions of such nodes. Also, for subprogram bodies that are encountered that might not have a separate declaration (such as type init procedures), reset the Scope of the subprogram's entity. From-SVN: r279289
2019-12-12[Ada] Missing error on incorrect use of Result attributeJustin Squirek2-0/+6
2019-12-12 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute): Add error message for invalid usage of Attribute_Result. From-SVN: r279288
2019-12-12[Ada] Crash on Descriptor_Size attributeBob Duff2-0/+10
2019-12-12 Bob Duff <duff@adacore.com> gcc/ada/ * sem_attr.adb (Eval_Attribute): Never mark T'Descriptor_Size as static, even if T is a static subtype, because otherwise we will request the value of the attribute, which will crash because we have not evaluated it. From-SVN: r279287
2019-12-12[Ada] Missing length check on private type with unknown discriminantsEd Schonberg2-7/+23
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch5.adb (Expand_N_Assognment_Statement): Extend the processing involving private types with unknown discriminants to handle the case where the full view of the type is an unconstrained array type. From-SVN: r279286
2019-12-12[Ada] Compiler crash on prefix call in generic bodyBob Duff2-46/+50
2019-12-12 Bob Duff <duff@adacore.com> gcc/ada/ * sem_ch4.adb (Transform_Object_Operation): Deal properly with prefix notation in instances. From-SVN: r279285
2019-12-12[Ada] Use correct subtype for call to Last in formal vectorsClaire Dross3-2/+7
2019-12-12 Claire Dross <dross@adacore.com> gcc/ada/ * libgnat/a-cofove.adb, libgnat/a-cfinve.adb (Find_Index): Use Extended_Index for call to Last. From-SVN: r279284
2019-12-12[Ada] Fix a number of typos, plus minor reformattingGary Dismukes3-17/+19
2019-12-12 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * sem_ch3.adb, sem_util.adb: Minor reformatting. From-SVN: r279283
2019-12-12[Ada] Update gnatmetric documentation for average lengthsBob Duff2-4/+7
2019-12-12 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatmetric documentation for average lengths From-SVN: r279282
2019-12-12[Ada] Constraint is ignored on constrained access record componentEd Schonberg4-17/+139
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Constrain_Access): Remove obsolete comments and warning concerning component types of an access type whose designated type is a constrained record type. (Such constraints were previously ignored). Set scope of itype for component to the scope of the enclosing record. * sem_ch4.adb: Remove call to Set_Ekind. * sem_util.adb (Build_Actual_Subtype_Of_Component): Handle components whose type is an access to a constrained discriminant, where the constraints may be given by the discriminants of the enclosing type. New subprogram Build_Access_Record_Constraint. gcc/testsuite/ * gnat.dg/warn24.adb: Remove expected warning. From-SVN: r279281
2019-12-12[Ada] Crash on use of Loop_Entry, Result, and Old as actualsJustin Squirek3-1/+43
2019-12-12 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Added null case for 'Loop_Entry, 'Old, and 'Result when calculating whether to create extra accessibility parameters. * sem_util.adb (Dynamic_Accessibility_Level): Added null case for 'Loop_Entry, 'Old, and 'Result when calculating accessibility level based on access-valued attributes. Also added special handling for uses of 'Loop_Entry when used in its indexed component form. From-SVN: r279280
2019-12-12[Ada] Remove references to VMSArnaud Charlet2-72/+7
2019-12-12 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * raise-gcc.c: Remove references to VMS From-SVN: r279279
2019-12-12[Ada] Mark Ada subprograms and variables referenced from gigiEric Botcazou42-199/+352
2019-12-12 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * atree.ads, comperr.ads, debug.ads, einfo.ads, elists.ads, err_vars.ads, errout.ads, exp_ch11.ads, exp_code.ads, exp_dbug.ads, exp_tss.ads, exp_util.ads, lib.ads, namet.ads, nlists.ads, opt.ads, repinfo.ads, restrict.ads, scos.ads, sem_aggr.ads, sem_aux.ads, sem_eval.ads, sem_util.ads, sinfo.ads, sinput.ads, stringt.ads, targparm.ads, types.ads, urealp.ads warnsw.ads: Add WARNING line(s) in commentary. * atree.h, elists.h, namet.h, nlists.h, repinfo.h, scos.h, stringt.h, types.h, uintp.h, urealp.h: Tidy up. * fe.h: Likewise. Document WARNING mark. From-SVN: r279278
2019-12-12[Ada] Improve end of command line arguments detectionDmitriy Anisimkov3-9/+46
2019-12-12 Dmitriy Anisimkov <anisimko@adacore.com> gcc/ada/ * libgnat/g-comlin.ads (Get_Argument): New routine similar to original Get_Argument but with one more out parameter End_Of_Arguments. (Get_Arguments): Comment improved. * libgnat/g-comlin.adb (Get_Argument): Implementation taken from original Get_Argument and improved. (Get_Argument): Calls new routine Get_Argument with additional parameter. From-SVN: r279277
2019-12-03re PR bootstrap/92783 (SEGV in field_byte_offset)Eric Botcazou1-7/+7
PR bootstrap/92783 * gcc-interface/utils.c (rest_of_record_type_compilation): Move down the guard for the position of fields in the descriptive type. From-SVN: r278948
2019-12-03utils.c (potential_alignment_gap): Delete.Eric Botcazou2-62/+37
* gcc-interface/utils.c (potential_alignment_gap): Delete. (rest_of_record_type_compilation): Do not call above function. Use the alignment of the field instead of that of its type, if need be. When the original field has variable size, always lower the alignment of the pointer type. Reset the bit-field status of the new field if it does not encode a bit-field. From-SVN: r278930
2019-12-03utils.c (fold_convert_size): New function.Eric Botcazou2-7/+20
* gcc-interface/utils.c (fold_convert_size): New function. (fold_bit_position): Invoke it to do further folding. From-SVN: r278929
2019-12-03decl.c (gnat_to_gnu_subprog_type): With the Copy-In/ Copy-Out mechanism...Eric Botcazou2-8/+58
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): With the Copy-In/ Copy-Out mechanism, do not promote the mode of the return type to an integral mode if it contains a field on a non-integral type and even demote it for 64-bit targets. From-SVN: r278927
2019-11-25re PR ada/92362 (double elaboration of expression in Address aspect)Eric Botcazou2-4/+10
PR ada/92362 * gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>: Use a temporary instead of clobbering the result with a freeze node. From-SVN: r278675
2019-11-25re PR ada/92575 (couple of suspicious assignments in expect.c)Eric Botcazou2-2/+7
PR ada/92575 * expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo. From-SVN: r278671
2019-11-06introduce -fcallgraph-info optionEric Botcazou2-3/+5
This was first submitted many years ago https://gcc.gnu.org/ml/gcc-patches/2010-10/msg02468.html The command line option -fcallgraph-info is added and makes the compiler generate another output file (xxx.ci) for each compilation unit (or LTO partitoin), which is a valid VCG file (you can launch your favorite VCG viewer on it unmodified) and contains the "final" callgraph of the unit. "final" is a bit of a misnomer as this is actually the callgraph at RTL expansion time, but since most high-level optimizations are done at the Tree level and RTL doesn't usually fiddle with calls, it's final in almost all cases. Moreover, the nodes can be decorated with additional info: -fcallgraph-info=su adds stack usage info and -fcallgraph-info=da dynamic allocation info. for gcc/ChangeLog From Eric Botcazou <ebotcazou@adacore.com>, Alexandre Oliva <oliva@adacore.com> * common.opt (-fcallgraph-info[=]): New option. * doc/invoke.texi (Developer options): Document it. * opts.c (common_handle_option): Handle it. * builtins.c (expand_builtin_alloca): Record allocation if -fcallgraph-info=da. * calls.c (expand_call): If -fcallgraph-info, record the call. (emit_library_call_value_1): Likewise. * flag-types.h (enum callgraph_info_type): New type. * explow.c: Include stringpool.h. (set_stack_check_libfunc): Set SET_SYMBOL_REF_DECL on the symbol. * function.c (allocate_stack_usage_info): New. (allocate_struct_function): Call it for -fcallgraph-info. (prepare_function_start): Call it otherwise. (record_final_call, record_dynamic_alloc): New. * function.h (struct callinfo_callee): New. (CALLEE_FROM_CGRAPH_P): New. (struct callinfo_dalloc): New. (struct stack_usage): Add callees and dallocs. (record_final_call, record_dynamic_alloc): Declare. * gimplify.c (gimplify_decl_expr): Record dynamically-allocated object if -fcallgraph-info=da. * optabs-libfuncs.c (build_libfunc_function): Keep SYMBOL_REF_DECL. * print-tree.h (print_decl_identifier): Declare. (PRINT_DECL_ORIGIN, PRINT_DECL_NAME, PRINT_DECL_UNIQUE_NAME): New. * print-tree.c: Include print-tree.h. (print_decl_identifier): New function. * toplev.c: Include print-tree.h. (callgraph_info_file): New global variable. (callgraph_info_external_printed): Likewise. (output_stack_usage): Rename to... (output_stack_usage_1): ... this. Make it static, add cf parameter. If -fcallgraph-info=su, print stack usage to cf. If -fstack-usage, use print_decl_identifier for pretty-printing. (INDIRECT_CALL_NAME): New. (dump_final_node_vcg_start): New. (dump_final_callee_vcg, dump_final_node_vcg): New. (output_stack_usage): New. (lang_dependent_init): Open and start file if -fcallgraph-info. Allocated callgraph_info_external_printed. (finalize): If callgraph_info_file is not null, finish it, close it, and release callgraph_info_external_printed. for gcc/ada/ChangeLog * gcc-interface/misc.c (callgraph_info_file): Delete. Co-Authored-By: Alexandre Oliva <oliva@adacore.com> From-SVN: r277876
2019-10-27* locales.c (iso_3166): Add missing comma after "United-States".Jakub Jelinek2-1/+5
From-SVN: r277492
2019-10-15Makefile.rtl (a-except.o): Put -O1 earlier so that it can be overriden if ↵Arnaud Charlet2-2/+7
needed by other variables. * Makefile.rtl (a-except.o): Put -O1 earlier so that it can be overriden if needed by other variables. From-SVN: r276988
2019-10-12re PR ada/91995 (gnat miscompilation and bootstrap failure on m68k-linux)Eric Botcazou5-61/+36
PR ada/91995 * sem_ch8.adb (Chain_Use_Clause): Remove second argument in calls to Defining_Entity. * sem_elab.adb (Find_Unit_Entity): Likewise. Deal with N_Subunit here in lieu of in Defining_Entity. * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters. * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters, and adjust accordingly. Deal with N_Compilation_Unit. From-SVN: r276916
2019-10-11decl.c (elaborate_reference_1): Specifically deal with pointer displacement.Eric Botcazou3-3/+21
* gcc-interface/decl.c (elaborate_reference_1): Specifically deal with pointer displacement. * gcc-interface/decl.c (components_to_record): Use proper name. * gcc-interface/trans.c (Sloc_to_locus): Use standard types. From-SVN: r276874