aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2020-07-08[Ada] Style cleanups related to Current_ConditionPiotr Trojanek4-6/+4
gcc/ada/ * einfo.ads (Current_Value): Fix typo in comment. * exp_ch2.adb (Expand_Current_Value): Remove unnecessary "Start of processing ..." comment. * exp_util.adb (Set_Entity_Current_Value): Fix unbalanced paren in comment. (Get_Current_Value_Condition): Fix layout in comment. * sem_ch5.adb (Analyze_Cond_Then): Replace commented condition with pragma Assert.
2020-07-08[Ada] Extend optimization to True/False prefixed with StandardPiotr Trojanek1-6/+6
gcc/ada/ * exp_ch5.adb (Expand_N_If_Statement): Detect True/False prefixed with Standard.
2020-07-08[Ada] Check predicates for subtypes of private typesBob Duff2-5/+17
gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specifications): Add freeze node for the Underlying_Full_View if it exists. The freeze node is what triggers the generation of the predicate function. * freeze.adb: Minor reformatting.
2020-07-08[Ada] Small tweak to Narrow_Large_Operation procedureEric Botcazou1-3/+5
gcc/ada/ * exp_ch4.adb (Narrow_Large_Operation): Use the base type instead of the first subtype of standard integer types as narrower type.
2020-07-08Daily bump.GCC Administrator1-0/+215
2020-07-07[Ada] Small adjustment in the handling of alignment for arraysEric Botcazou2-20/+21
gcc/ada/ * freeze.adb (Freeze_Array_Type): Use Ctyp more consistently. Move code setting the alignment in the non-packed case to... * layout.adb (Layout_Type): ...here.
2020-07-07[Ada] Avoid crash on node extensionBob Duff1-0/+9
gcc/ada/ * treepr.adb (Print_Node): Add code to test Is_Extension.
2020-07-07[Ada] Assert failure on invalid Variable_IndexingArnaud Charlet1-0/+7
gcc/ada/ * sem_ch4.adb (Try_Container_Indexing): Add ??? comment. Protect against malformed tree in case of errors.
2020-07-07[Ada] Use Is_Generic_Subprogram where possiblePiotr Trojanek4-10/+5
gcc/ada/ * einfo.adb, sem_ch10.adb, sem_ch12.adb, sem_ch8.adb: Use Is_Generic_Subprogram.
2020-07-07[Ada] Fix typo in code to get a better error messagePiotr Trojanek1-4/+3
gcc/ada/ * sem_ch8.adb (Analyze_Use_Package): Replace low-level, error-prone Ekind_In tests with high-level Is_Generic_Subprogram and Is_Subprogram.
2020-07-07[Ada] ACATS 4.1J - B854003 - Subtype conformance check missed #2Arnaud Charlet1-13/+51
gcc/ada/ * sem_ch6.adb (Check_Formal_Subprogram_Conformance): New subprogram to handle checking without systematically emitting an error. (Check_Conformance): Update call to Check_Formal_Subprogram_Conformance and fix handling of Conforms and Errmsg parameters.
2020-07-07[Ada] ACATS 4.1K - C452003Arnaud Charlet8-192/+75
gcc/ada/ * exp_ch4.adb (Tagged_Membership): Generate a call to CW_Membership instead of using Build_CW_Membership. (Expand_N_In): Remove wrong handling of null access types and corresponding comment. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Generate a call to CW_Membership instead of using Build_CW_Membership. * rtsfind.ads: Add CW_Membership. * exp_atag.ads, exp_atag.adb (Build_CW_Membership): Removed. * einfo.ads: Fix typo. * libgnat/a-tags.ads, libgnat/a-tags.adb (CW_Membership): Moved back to spec.
2020-07-07[Ada] Errors in handling of access_to_subprogram contractsEd Schonberg2-13/+20
gcc/ada/ * exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Create proper subprogram specification for body, using names in the subprogram declaration but distinct entities. * exp_ch6.adb (Expand_Call): If this is an indirect call involving a subprogram wrapper, insert pointer parameter in list of actuals with a parameter association, not as a positional parameter.
2020-07-07[Ada] Hang on conditional expression as actualJustin Squirek1-1/+9
gcc/ada/ * exp_ch6.adb (Expand_Branch): Verify the original node is a conditional expression before recursing further. (Insert_Level_Assign): Transform assertion into an explicit raise.
2020-07-07[Ada] Simplify statically known Max_Size_In_Storage_Elements attribute in ↵Steve Baird1-3/+13
more cases gcc/ada/ * sem_attr.adb (Eval_Attribute): Generalize static evaluation of Size attribute references to also handle Max_Size_In_Storage_Elements references.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda1-2/+1
gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Code cleanup.
2020-07-07[Ada] Move generation of range checks for entry families to expanderEric Botcazou6-23/+46
gcc/ada/ * checks.ads (Expander Routines): Update the description of the Do_Range_Check mechanism. * checks.adb (Selected_Range_Checks): Fix typo. * exp_ch9.adb: Add with and use clause for Checks. (Actual_Index_Expression): Generate a range check if requested. (Entry_Index_Expression): Likewise. * sem_attr.adb (Resolve_Attribute) <Attribute_Count>: Call Apply_Scalar_Range_Check instead of Apply_Range_Check. * sem_ch9.adb (Analyze_Accept_Statement): Likewise. * sem_res.adb (Resolve_Entry): Likewise, after having set the actual index type on the prefix of the indexed component. (Resolve_Indexed_Component): Remove useless conditional construct.
2020-07-07[Ada] Freeze aspect expression relocated to pragma PreconditionPiotr Trojanek1-2/+6
gcc/ada/ * contracts.adb (Analyze_Entry_Or_Subprogram_Contract, Process_Preconditions_For): Freeze expression that has been relocated to pragma Precondition, not the expression which is still in the aspect.
2020-07-07[Ada] ACATS 4.1H - BC60005 - null exclusion matching for formal subprogramsArnaud Charlet4-91/+45
gcc/ada/ * sem_ch6.adb (Check_Conformance): Remove unnecessary (and wrong) code. * sem_ch8.adb (Check_Null_Exclusion): Post error at proper location. Introduce new helper Null_Exclusion_Mismatch and fix implementation wrt formal subprograms used in generic bodies. (Analyze_Subprogram_Renaming): Fix missing setting of Error_Msg_Sloc. (Analyze_Object_Renaming): Replace "in Anonymous_Access_Kind" by Is_Anonymous_Access_Type. * sem_util.adb (Has_Null_Exclusion): Fix handling of N_Parameter_Specification. * sem_ch12.adb (Instantiate_Object): Replace "in Anonymous_Access_Kind" by Is_Anonymous_Access_Type.
2020-07-07[Ada] Handle explicit dereferences in expression functionsEd Schonberg1-0/+9
gcc/ada/ * freeze.adb (Freeze_Expr_Types): Freeze the designated type of the explicit dereference.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda1-0/+3
gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Protect reading attribute Etype.
2020-07-07[Ada] Use pragma Unsuppress in Time_IOBob Duff1-13/+12
gcc/ada/ * libgnat/g-catiio.adb (Value, Parse_ISO_8601): Unsuppress checks, and don't rely on 'Valid.
2020-07-07[Ada] Add support for XDR streaming in the default runtimeArnaud Charlet3-4/+17
gcc/ada/ * Makefile.rtl: Remove dead code. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document gnatbind -xdr switch. * gnat_ugn.texi: Regenerate.
2020-07-07[Ada] Fix documentation of -gnatVa switchPiotr Trojanek2-2/+2
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Validity Checking): Add "p" to the list of switches enabled by -gnatVa. * gnat_ugn.texi: Regenerate.
2020-07-07[Ada] Ensure No_Specification_Of_Aspect forbids pragmas and repr. clausesGhjuvan Lacambre4-4/+26
gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Add call to Check_Restriction_No_Specification_Of_Aspect. * sem_prag.adb (Analyze_Pragma): Likewise. * restrict.ads (Check_Restriction_No_Specification_Of_Aspect): Mention possible new node kinds in documentation. * restrict.adb (Check_Restriction_No_Specification_Of_Aspect): Retrieve aspect id from different fields if given node is an N_Pragma or an N_Attribute_Definition_Clause.
2020-07-07[Ada] Checking type invariants on in params of procedures, not functions ↵Gary Dismukes2-68/+82
(AI12-0044) gcc/ada/ * contracts.adb (Add_Invariant_And_Predicate_Checks): Relax the condition for doing invariant checks so that in-mode parameters of procedures are also checked (required by AI05-0289, and restricted to procedures by AI12-0044). This is done in a procedure's nested postconditions procedure. * exp_ch6.adb (Expand_Actuals): Also perform postcall invariant checks for in parameters of procedures (but not functions). Moved invariant-checking code to end of Expand_Actuals (including the nested function Is_Public_Subp).
2020-07-07[Ada] Change local object from variable to constantPiotr Trojanek1-6/+4
gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): Make Index_Type a constant.
2020-07-07[Ada] Fix expansion of delta aggregates with slicesPiotr Trojanek1-1/+1
gcc/ada/ * exp_aggr.adb (Expand_N_Delta_Aggregate): Use type of the delta base expression for the anonymous object of the delta aggregate.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda2-194/+239
gcc/ada/ * sem_util.ads (Interval_Lists): Reordering routine. * sem_util.adb (Interval_Lists): Reordering routines to keep them alphabetically ordered.
2020-07-07[Ada] Remove extra checks for non-static context from resolving 'UpdatePiotr Trojanek1-3/+0
gcc/ada/ * sem_attr.adb (Resolve_Attribute): Do not call Check_Non_Static_Context.
2020-07-07[Ada] Spurious elaboration warnings with -gnatc and null proceduresArnaud Charlet1-5/+14
gcc/ada/ * sem_elab.adb (Is_Guaranteed_ABE): Take into account null procedures.
2020-07-07[Ada] Minor cleanup with Is_AssignablePiotr Trojanek1-3/+1
gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Reuse Is_Assignable.
2020-07-07[Ada] Set range checks for for 'Update on arrays in GNATprove expansionPiotr Trojanek2-32/+76
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Add scalar range checks for 'Update on arrays just like for 'Update on records. * sem_attr.adb (Analyze_Array_Component_Update): Do not set range checks for single-dimensional arrays. (Resolve_Attribute): Do not set range checks for both single- and multi- dimensional arrays.
2020-07-07[Ada] Style fixes in the description of Analysis-Resolution-ExpansionPiotr Trojanek1-4/+4
gcc/ada/ * sem.ads (Sem): Fix description.
2020-07-07[Ada] Allow aspect Relaxed_Initialization on protected entriesPiotr Trojanek1-1/+1
gcc/ada/ * sem_ch13.adb (Analyze_Relaxed_Parameter): Fix for protected entries.
2020-07-07Daily bump.GCC Administrator1-0/+268
2020-07-06[Ada] Avoid forced loading of System.Priority in CodePeer modePiotr Trojanek1-1/+1
gcc/ada/ * checks.adb (Apply_Scalar_Range_Check): Use Is_RTE.
2020-07-06[Ada] Time_IO.Image: Allow printing the time zoneBob Duff2-6/+77
gcc/ada/ * libgnat/g-catiio.ads: Document newly supported format. Add ISO_Time constant, for convenience. * libgnat/g-catiio.adb (Image_Helper): New helper function to do all the formatting work, called by the two exported Image functions. Add support for "%:::z" here. Add a Time_Zone parameter used by the "%:::z" processing. This parameter is not used for the actual time zone computations; local time is always used for that, for ease of implementation reasons. It would make sense to use Append throughout this function, but that's a cleanup for another day. (Image): Modify these to pass the local time zone, or the specified time zone, as appropriate.
2020-07-06[Ada] Time_IO.Value: Allow subseconds and time zones togetherBob Duff2-25/+25
gcc/ada/ * libgnat/g-catiio.ads: Change the regular expression that documents the allowed format to match what ISO-8601 allows. * libgnat/g-catiio.adb (Scan_Subsecond): Rewrite so it doesn't assume the subsecond comes last. (Parse_ISO_8601): Parse an optional subsecond, followed by an optional time zone, rather than making these alternatives to each other.
2020-07-06[Ada] Clean up GNAT.Calendar.Time_IO.ValueBob Duff1-62/+55
gcc/ada/ * libgnat/g-catiio.adb (Parse_ISO_8601): Minor cleanups: Give some objects clearer names. Make some objects more local to where they are used. Remove some validity checks that can't fail, because some of the variables tested have been moved so they're not visible here. Anyway, Wrong_Syntax is about errors in the input, not data validity. Use Time_Zone_Seen instead of Local_Sign = ' ' to determine that a time zone indication was seen. We don't need to distinguish two different kinds of syntax error (End_Of_Source_Reached and Wrong_Syntax), so use Wrong_Syntax always. Remove comment, "Certain scanning scenarios may handle this exception on their own."; there are no such scenarios.
2020-07-06[Ada] Implement Time_IO.Image with Time_ZoneBob Duff2-2/+30
gcc/ada/ * libgnat/g-catiio.ads, libgnat/g-catiio.adb (Image): New function. It might seem like the local-time Image should be implemented in terms of the Time_Zone Image, but that would be far harder to implement, so we do it the other way around.
2020-07-06[Ada] Use Stream_Element_Arrays internally for secure hash computationsThomas Quinot3-75/+84
gcc/ada/ * libgnat/g-sechas.ads, libgnat/g-sechas.adb: Refactor to use Stream_Element_Array as the internal buffer type. * libgnat/g-shshco.adb: Adjust to use Stream_Element_Offset instead of Integer as the index in the internal state buffer.
2020-07-06[Ada] Various typo fixes and reformatting of commentsGary Dismukes8-40/+42
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst, errout.ads, erroutc.adb, exp_ch4.adb, exp_ch6.adb, freeze.adb: Comment rewording/reformatting/typo fixes. Replace "ie." with "that is" in comment; "can not" -> "cannot", and remove an extraneous underscore in another comment. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2020-07-06[Ada] Ada2020: AI12-0198 potentially unevaluated array componentsJavier Miranda2-8/+224
gcc/ada/ * sem_util.ads (Interval_Lists.Aggregate_Intervals): New subprogram. * sem_util.adb (Has_Null_Others_Choice, Non_Static_Or_Null_Range, Interval_Lists.Aggregate_Intervals): New subprograms. (Is_Potentially_Unevaluated): Adding support to detect potentially unevaluated components of array aggregates.
2020-07-06[Ada] Correct time zone in GNAT.Calendar.Time_IO.ValueBob Duff6-64/+62
gcc/ada/ * libgnat/g-catiio.adb (Parse_ISO_8601): New name for Parse_ISO_8861_UTC. 8601 is the correct ISO standard number. Also, "UTC" was confusing. All Time values are represented in UTC, but the ISO 8601 date strings include a time zone. If a time zone was specified, call Ada.Calendar.Formatting.Time_Of instead of GNAT.Calendar.Time_Of, because the latter adjusts to the current time zone, whereas we want to use (just) the time zone specified in the ISO string. This allows us to pass Time_Zone instead to Time_Of, instead of adjusting by Local_Disp by hand. If no time zone was specified, call GNAT.Calendar.Time_Of as before. Use expanded names to clarify which Time_Of is being called. Remove redundant comment, and move nonredundant part of the commment to the spec. (Value): Minor: use "not in" instead of "or else". * libgnat/g-catiio.ads: Comment moved here. Correct the ISO standard number. * libgnat/g-calend.adb: Add ??? comments. * libgnat/a-calend.ads, libgnat/a-calend.adb: Update obsolete comments regarding the representation of type Time. Move the information about the epoch (year 2150) to the spec, and avoid uttering "2150" more than once. * libgnat/a-catizo.ads (Time_Offset): Add comment.
2020-07-06[Ada] Crash on derived type with rep. clause and renamed discriminantEd Schonberg1-0/+12
gcc/ada/ * exp_ch5.adb (Find_Component): If the target type is a derived record type and the required component is a discriminant that is renamed in the derived type declaration, use the name of the original discriminant to locate the intended target component.
2020-07-06[Ada] Hang on generic declaration with ambiguous formal packageJustin Squirek1-4/+13
gcc/ada/ * sem_ch12.adb (Analyze_Associations): Add check for errors on the generic formal before continuing with instantiation.
2020-07-06[Ada] AI12-0366 Changes to Big_Integer and Big_RealArnaud Charlet3-10/+11
gcc/ada/ * libgnat/a-nbnbin.ads, libgnat/a-nbnbin.adb, libgnat/a-nbnbin__gmp.adb: Use more Valid_Big_Integer.
2020-07-06[Ada] Fix typo in comment of Get_Index_SubtypePiotr Trojanek1-1/+1
gcc/ada/ * exp_util.ads (Get_Index_Subtype): Fix duplicate "Last".
2020-07-06[Ada] There is no Expressions field in N_Delta_Aggregate nodeEd Schonberg1-1/+1
gcc/ada/ * sinfo.ads: Indicate that Field 1 of an N_Delta_Aggregate is unused. Previously it was erroneously labelled as holding an Expressions list, in analogy with other aggregate constructs, but there are no Expressions attached to this node syntactically or semantically.