aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2020-07-16[Ada] Small cleanup in interface with GCC back-endEric Botcazou2-4/+0
gcc/ada/ * fe.h (Is_OK_Static_Expression): Delete. * sem_eval.ads (Is_OK_Static_Expression): Remove WARNING note.
2020-07-16[Ada] Incorrect static accessibility error in return aggregateJustin Squirek4-5/+37
gcc/ada/ * einfo.adb, einfo.ads (Is_Named_Access_Type): Created for readability. * sem_ch6.adb (Check_Return_Construct_Accessibility): Add special cases for formals. * sem_util.adb (Object_Access_Level): Add handling of access attributes and named access types in the general case.
2020-07-16[Ada] Simplify detection of others choice with just one valuePiotr Trojanek1-1/+1
gcc/ada/ * sem_case.adb (Build_Choice): Simplify.
2020-07-16[Ada] Disable Initialize_Scalars on runtime filesArnaud Charlet1-0/+10
gcc/ada/ * frontend.adb: Disable Initialize_Scalars on runtime files.
2020-07-16[Ada] Do not perform null exclusion static checks on generated entitiesGhjuvan Lacambre1-1/+1
gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Add Comes_From_Source call.
2020-07-16[Ada] Avoid false positive reported by CodePeerJavier Miranda1-1/+1
gcc/ada/ * exp_attr.adb (Expand_Access_To_Protected_Op): Initialize variable Sub to Empty to avoid false positive reported by Codepeer.
2020-07-16[Ada] Spurious redundant use clause warningArnaud Charlet1-4/+11
gcc/ada/ * sem_ch8.adb (Note_Redundant_Use): Add missing warning tag. Do not check for redundant use clauses in predefined units to avoid misleading warnings that may occur as part of a rtsfind load.
2020-07-16[Ada] Ada2020: AI12-0107 convention of By_Protected_ProcedureJavier Miranda5-20/+203
gcc/ada/ * exp_attr.adb (Has_By_Protected_Procedure_Prefixed_View): New subprogram. (Expand_Access_To_Protected_Op): Adding support for prefixed class-wide view with By_Protected_Procedure convention. * sem_attr.adb (Get_Convention): New subprogram. (Get_Kind): Adapted to use Get_Convention. * sem_ch4.adb (Try_By_Protected_Procedure_Prefixed_View): New subprogram. (Analyze_Selected_Component): Invoke Try_By_Protected_Procedure_Prefixed_View. * sem_util.ads (Is_By_Protected_Procedure): New subprogram. * sem_util.adb (Is_By_Protected_Procedure): New subprogram.
2020-07-16[Ada] Overflow in string streamingArnaud Charlet2-10/+19
gcc/ada/ * libgnat/s-ststop.ads: Fix typo. * libgnat/s-ststop.adb (Read, Write): Fix block number computation to avoid overflows in case of large strings.
2020-07-16[Ada] Add centralized capacity check in Generic_BignumsArnaud Charlet1-19/+12
gcc/ada/ * libgnat/s-genbig.adb ("**"): Remove capacity limit check. Improve code by using an extended return. (Normalize): Perform capacity limit check here instead which is the centralized place where (potentially large) big integers are allocated.
2020-07-16[Ada] AI12-0042: Type invariant checking rulesGary Dismukes2-1/+108
gcc/ada/ * exp_ch4.adb (Expand_N_Type_Conversion): Handle the case of applying an invariant check for a conversion to a class-wide type whose root type has a type invariant, when the conversion appears within the immediate scope of the type and the expression is of a specific tagged type. * sem_ch3.adb (Is_Private_Primitive): New function to determine whether a primitive subprogram is a private operation. (Check_Abstract_Overriding): Enforce the restriction imposed by AI12-0042 of requiring overriding of an inherited nonabstract private operation when the ancestor has a class-wide type invariant and the ancestor's private operation is visible. (Derive_Subprogram): Set Requires_Overriding on a subprogram inherited from a visible private operation of an ancestor to which a Type_Invariant'Class expression applies.
2020-07-16Daily bump.GCC Administrator1-0/+258
2020-07-15[Ada] Cleanup code related to object overlaysPiotr Trojanek1-2/+2
gcc/ada/ * sem_util.adb (Find_Overlaid_Entity): Fix style in comment. (Note_Possible_Modification): Simplify repeated calls to Ekind.
2020-07-15[Ada] Cleanup in Convert_To_Positional after previous workEric Botcazou1-15/+3
gcc/ada/ * exp_aggr.adb (Flatten): Adjust description. (Convert_To_Positional): Remove obsolete ??? comment and use Compile_Time_Known_Value in the final test.
2020-07-15[Ada] Ongoing work for AI12-0212: container aggregatesArnaud Charlet9-30/+153
gcc/ada/ * par-ch4.adb (P_Iterated_Component_Association): Extended to recognzize the similar Iterated_Element_Association. This node is only generated when an explicit Key_Expression is given. Otherwise the distinction between the two iterated forms is done during semantic analysis. * sinfo.ads: New node N_Iterated_Element_Association, for Ada202x container aggregates. New field Key_Expression. * sinfo.adb: Subprograms for new node and newn field. * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle the case where the Iteration_Scheme is an Iterator_Specification. * exp_aggr.adb (Wxpand_Iterated_Component): Handle a component with an Iterated_Component_Association, generate proper loop using given Iterator_Specification. * exp_util.adb (Insert_Axtions): Handle new node as other aggregate components. * sem.adb, sprint.adb: Handle new node. * tbuild.adb (Make_Implicit_Loop_Statement): Handle properly a loop with an Iterator_ specification.
2020-07-15[Ada] Fix logic in Allocate_Any_ControlledArnaud Charlet1-6/+9
gcc/ada/ * libgnat/s-stposu.adb (Allocate_Any_Controlled): Fix logic in lock/unlock.
2020-07-15[Ada] Target name is an object referencePiotr Trojanek1-0/+5
gcc/ada/ * sem_util.adb (Is_Object_Reference): Return True on N_Target_Name.
2020-07-15[Ada] Spurious error on Predicate_Failure aspectArnaud Charlet1-0/+2
gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Add proper handling of Aspect_Predicate_Failure, consistent with Check_Aspect_At_Freeze_Point.
2020-07-15[Ada] Mention -gnat2020 in error messageArnaud Charlet1-1/+2
gcc/ada/ * sem_ch13.adb (Check_Aspect_Too_Late): Mention -gnat2020 switch in error message.
2020-07-15[Ada] Do not generate elaboration code for alignment aspectEric Botcazou4-9/+21
gcc/ada/ * einfo.ads (Delayed Freezing and Elaboration): Adjust description. * freeze.adb (Freeze_Object_Declaration): Likewise. * sem_ch3.adb (Delayed_Aspect_Present): Likewise. Do not return true for Alignment. * sem_ch13.adb (Analyze_Aspect_Specifications): Do not always delay for Alignment. Moreover, for Alignment and various Size aspects, do not delay if the expression is an attribute whose prefix is the Standard package.
2020-07-15[Ada] Do not generate extra copies inside initialization proceduresEric Botcazou1-0/+7
gcc/ada/ * exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): Return false inside an initialization procedure.
2020-07-15[Ada] Guard against access to wrong fields in Is_RenamingGhjuvan Lacambre1-2/+22
gcc/ada/ * sem_util.adb (Is_Renaming): Add ekind checks.
2020-07-15[Ada] Remove doc on obsolete toolsArnaud Charlet2-2645/+184
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove doc on obsolete tools. * gnat_ugn.texi: Regenerate.
2020-07-15[Ada] Assert failure with -gnatwrArnaud Charlet1-4/+3
gcc/ada/ * sem_res.adb (Resolve_Type_Conversion): Protect against null entity. Add proper tag for -gnatwr warning.
2020-07-15[Ada] Missing error on operator callArnaud Charlet2-5/+9
gcc/ada/ * sem_ch6.adb (Analyze_Procedure_Call): Detect use of operators in a procedure call. * sem_util.adb: Minor edit.
2020-07-15[Ada] Fix for possibly null ranges in 'Update and delta_aggregatePiotr Trojanek1-2/+2
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Apply scalar range checks against the base type of an index type, not against the index type itself.
2020-07-15[Ada] Small addition and tweaks in documentation on freezingEric Botcazou1-5/+7
gcc/ada/ * einfo.ads (Delayed Freezing and Elaboration): Minor tweaks. Document the discrepancy between the aspect and the non-aspect cases for alignment settings in object declarations.
2020-07-15[Ada] ACATS 4.1P [BDB4001] - 13.11.4(22-23/3) not enforcedArnaud Charlet2-39/+137
gcc/ada/ * exp_ch3.adb (Freeze_Type): Remove warning in expander, replaced by a corresponding error in sem_ch13.adb. Replace RTE_Available by RTU_Loaded to avoid adding unnecessary dependencies. * sem_ch13.adb (Associate_Storage_Pool): New procedure. (Analyze_Attribute_Definition_Clause [Attribute_Simple_Storage_Pool| Attribute_Storage_Pool]): Call Associate_Storage_Pool to add proper legality checks on subpools.
2020-07-15[Ada] Mark standard containers as not in SPARKYannick Moy48-48/+144
gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbdlli.ads, libgnat/a-cbhama.adb, libgnat/a-cbhama.ads, libgnat/a-cbhase.adb, libgnat/a-cbhase.ads, libgnat/a-cbmutr.adb, libgnat/a-cbmutr.ads, libgnat/a-cborma.adb, libgnat/a-cborma.ads, libgnat/a-cborse.adb, libgnat/a-cborse.ads, libgnat/a-cbprqu.adb, libgnat/a-cbprqu.ads, libgnat/a-cbsyqu.adb, libgnat/a-cbsyqu.ads, libgnat/a-cdlili.adb, libgnat/a-cdlili.ads, libgnat/a-cidlli.adb, libgnat/a-cidlli.ads, libgnat/a-cihama.adb, libgnat/a-cihama.ads, libgnat/a-cihase.adb, libgnat/a-cihase.ads, libgnat/a-cimutr.adb, libgnat/a-cimutr.ads, libgnat/a-ciorma.adb, libgnat/a-ciorma.ads, libgnat/a-ciormu.adb, libgnat/a-ciormu.ads, libgnat/a-ciorse.adb, libgnat/a-ciorse.ads, libgnat/a-cohama.adb, libgnat/a-cohama.ads, libgnat/a-cohase.adb, libgnat/a-cohase.ads, libgnat/a-coinve.adb, libgnat/a-coinve.ads, libgnat/a-comutr.adb, libgnat/a-comutr.ads, libgnat/a-convec.adb, libgnat/a-convec.ads, libgnat/a-coorma.adb, libgnat/a-coorma.ads, libgnat/a-coormu.adb, libgnat/a-coormu.ads, libgnat/a-coorse.adb, libgnat/a-coorse.ads: Add SPARK_Mode => Off.
2020-07-15[Ada] Fix oversight in Delayed_Aspect_Present predicateEric Botcazou2-4/+6
gcc/ada/ * sem_ch3.adb (Delayed_Aspect_Present): Fix oversight in loop. * freeze.adb (Freeze_Object_Declaration): Use Declaration_Node instead of Parent for the sake of consistency.
2020-07-15[Ada] Wrong resolution of 'access in protected subprogramJavier Miranda1-1/+23
gcc/ada/ * sem_attr.adb (Resolve_Attribute): Resolve overloaded N_Selected_Component prefix of 'Access. Required to handle overloaded prefixed view of protected subprograms.
2020-07-15[Ada] Documentation cleanupsArnaud Charlet3-879/+560
gcc/ada/ * doc/gnat_ugn/about_this_guide.rst: Remove old section and update for Ada 202x. * doc/gnat_ugn/getting_started_with_gnat.rst: Add a system requirements section. Remove obsolete section and minimal rewording on the getting started section. * gnat_ugn.texi: Regenerate.
2020-07-15[Ada] Fix slices and qualified expressions being effectively volatilePiotr Trojanek3-4/+11
gcc/ada/ * exp_ch5.adb (Expand_Assign_Array): Use short-circuit operator (style). * sem_res.adb (Resolve_Indexed_Component): Fix style in comment. * sem_util.adb (Is_Effectively_Volatile_Object): Handle slices just like indexed components; handle qualified expressions and type conversions lie in Is_OK_Volatile_Context. (Is_OK_Volatile_Context): Handle qualified expressions just like type conversions.
2020-07-15[Ada] Cleanup condition for an effectively volatile array typePiotr Trojanek2-18/+18
gcc/ada/ * sem_prag.adb (Atomic_Components): Simplify with Ekind_In. (Complex_Representation): Fix type of E_Id, which just like when for pragma Atomic_Components will hold an N_Identifier node, not an entity. * sem_util.adb (Is_Effectively_Volatile): Refactor to avoid unnecessary computation.
2020-07-15[Ada] Extend static functionsArnaud Charlet14-130/+362
gcc/ada/ * inline.adb, inline.ads (Inline_Static_Expression_Function_Call): Renamed Inline_Static_Function_Call. * sem_ch13.adb (Analyze_Aspect_Static): Allow static intrinsic imported functions under -gnatX. * sem_util.ads, sem_util.adb (Is_Static_Expression_Function): Renamed Is_Static_Function. (Is_Static_Expression_Function_Call): Renamed Is_Static_Function_Call. * sem_ch6.adb, sem_elab.adb, sem_res.adb: Update calls to Is_Static_Function*. * sem_eval.adb (Fold_Dummy, Eval_Intrinsic_Call, Fold_Shift): New. (Eval_Call): Add support for intrinsic calls, code refactoring. (Eval_Entity_Name): Code refactoring. (Eval_Logical_Op): Update comment. (Eval_Shift): Call Fold_Shift. Update comments. * par-prag.adb (Par [Pragma_Extensions_Allowed]): Set Ada_Version to Ada_Version_Type'Last to handle Extensions_Allowed (On) consistently. * opt.ads (Extensions_Allowed): Update documentation. * sem_attr.adb: Update comment. * doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation of Extensions_Allowed. * gnat_rm.texi: Regenerate.
2020-07-15[Ada] Potential access to uninitialized variableArnaud Charlet1-1/+3
gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Ensure Typ is never accessed uninitialized.
2020-07-15[Ada] Fix typo in "accommodate" in docs and commentsPiotr Trojanek3-3/+3
gcc/ada/ * doc/gnat_rm/representation_clauses_and_pragmas.rst: Fix typo. * gnat_rm.texi: Regenerate. * libgnat/s-secsta.ads (Memory_Alignment): Likewise.
2020-07-15[Ada] Minor reformatting of comments and some code, plus a typo correctionGary Dismukes3-19/+19
gcc/ada/ * exp_ch6.adb: Add a comma and fix a typo (machinary => machinery) in comment. * exp_aggr.adb: Reformat, fix capitalization, and add a couple of commas in a comment. Adjust columns in several code fragments. * sem_aggr.adb: Reformat and add a comma in a comment.
2020-07-15[Ada] Use Sloc of delay statement in timed entry callEric Botcazou1-2/+1
gcc/ada/ * exp_ch9.adb (Expand_N_Timed_Entry_Call): Use the Sloc of the delay statement in the expansion.
2020-07-15[Ada] Ongoing work for unnamed and named container aggregatesEd Schonberg2-38/+288
gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): New procedure, internal to Resolve_Container_Aggregate, to complete semantic analysis of Iterated_Component_Associations. * exp_aggr.adb (Expand_Iterated_Component): New procedure, internal to Expand_Container_Aggregate, to expand the construct into an implicit loop that performs individual insertions into the target aggregate.
2020-07-15[Ada] Spurious accessibility error on allocatorJustin Squirek1-0/+6
gcc/ada/ * exp_ch6.adb (Make_Build_In_Place_Call_Allocator): Normalize the associated node for internally generated objects to be like their SOAAT counter-parts.
2020-07-15[Ada] Fix potentially uninitialized variable flagged by CodePeerArnaud Charlet1-0/+3
gcc/ada/ * libgnat/g-socket.adb (Wait_On_Socket): Fix potentially uninitialized variable.
2020-07-11Daily bump.GCC Administrator1-0/+279
2020-07-10[Ada] Revert mistaken negation related to references to labelsPiotr Trojanek1-2/+2
gcc/ada/ * sem_ch8.adb (Find_Direct_Name): Fix code to match the comment.
2020-07-10[Ada] Add warning for overlays changing scalar storage orderEric Botcazou1-4/+6
gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause) <Address>: Issue an unconditional warning for an overlay that changes the scalar storage order.
2020-07-10[Ada] Fix detection of actual parameters for procedure callsPiotr Trojanek1-10/+24
gcc/ada/ * sem_ch8.adb (Is_Actual_Parameter): Fix processing when parent is a procedure call statement; extend comment.
2020-07-10[Ada] Ada2020: AI12-0368 Declare expressions can be staticBob Duff4-22/+122
gcc/ada/ * sem_res.adb (Resolve_Expression_With_Actions): Check the rules of AI12-0368, and mark the declare expression as static or known at compile time as appropriate. * sem_ch4.adb: Minor reformatting. * libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Allow up to 9 replacement parameters. I'm planning to use this in the test case for this ticket.
2020-07-10[Ada] Spurious error on parameterless acccess_to_subprogramEd Schonberg2-2/+9
gcc/ada/ * exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Create a proper signature when the access type denotes a parameterless subprogram. * exp_ch6.adb (Expand_Call): Handle properly a parameterless indirect call when the corresponding access type has contracts.
2020-07-10[Ada] Further improve the expansion of array aggregatesEric Botcazou1-73/+125
gcc/ada/ * exp_aggr.adb (Convert_To_Positional): Add Dims local variable and pass it in calls to Is_Flat and Flatten. (Check_Static_Components): Pass Dims in call to Is_Static_Element. (Nonflattenable_Next_Aggr): New predicate. (Flatten): Add Dims parameter and Expr local variable. Call Nonflattenable_Next_Aggr in a couple of places. In the case when an Others choice is present, check that the element is either static or a nested aggregate that can be flattened, before disregarding the replication limit for elaboration purposes. Check that a nested array is flattenable in the case of a multidimensional array in any position. Remove redundant check in the Others case and pass Dims in call to Is_Static_Element. Use Expr variable. (Is_Flat): Change type of Dims parameter from Int to Nat. (Is_Static_Element): Add Dims parameter. Replace tests on literals with call to Compile_Time_Known_Value. If everything else failed and the dimension is 1, preanalyze the expression before calling again Compile_Time_Known_Value on it. Return true for null. (Late_Expansion): Do not expand further if the assignment to the target can be done directly by the back end.
2020-07-10[Ada] Preserve casing of output filesArnaud Charlet2-41/+51
gcc/ada/ * osint-c.adb (Set_File_Name): Preserve casing of file. * osint.adb (File_Names_Equal): New. (Executable_Name): Use File_Equal instead of Canonical_Case_File_Name.