aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2019-12-16[Ada] Suppress unused warnings in the presence of errorsBob Duff2-0/+13
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * errout.adb (Handle_Serious_Error): Disable the above-mentioned warnings. From-SVN: r279441
2019-12-16[Ada] Minor: improve commentsBob Duff3-3/+11
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * errout.adb, errout.ads: Improve comments. From-SVN: r279440
2019-12-16[Ada] Minor comment fixBob Duff2-1/+5
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * sem_util.ads: Minor comment fix. From-SVN: r279439
2019-12-16[Ada] Check for "size for" in Special_Msg_DeleteBob Duff3-1/+19
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * errout.ads, errout.adb (Is_Size_Too_Small_Message): Check for "size for" instead of "size for& too small, minimum allowed is ^". From-SVN: r279438
2019-12-16[Ada] Do not set a bogus Esize on subtype built for Component_Size clauseEric Botcazou2-1/+7
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Set only the RM_Size on the subtype built for a Component_Size clause when the component type is a biased integer type. From-SVN: r279437
2019-12-16[Ada] Fix warning on _REENTRANTArnaud Charlet2-0/+6
2019-12-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * socket.c: Shutdown warning. From-SVN: r279436
2019-12-16[Ada] Mark Deallocator as Favor_Top_LevelArnaud Charlet2-0/+5
2019-12-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnarl/s-tataat.ads (Deallocator): Mark as Favor_Top_Level. From-SVN: r279435
2019-12-16[Ada] AI12-0234/321 atomic operationsArnaud Charlet11-2/+620
2019-12-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-aotase.adb, libgnat/s-aotase.ads, libgnat/s-atoope.ads, libgnat/s-atopar.adb, libgnat/s-atopar.ads, libgnat/s-atopex.adb, libgnat/s-atopex.ads: New files. * libgnat/s-atopri.ads: Add new intrinsics. * Makefile.rtl: Add new runtime files. * impunit.adb: Add new units to Ada 2020 list. From-SVN: r279434
2019-12-16[Ada] Remove new strict-alignment check added by AI12-0001Eric Botcazou2-16/+19
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * freeze.adb (Check_Strict_Alignment): Remove new check on Has_Aliased_Components for array types. From-SVN: r279433
2019-12-16[Ada] Crash on constrained container in generalized indexing operationEd Schonberg2-1/+13
2019-12-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch4.adb (Try_Container_Indexing): In the case of a derived container type, use the base type to look for candidate indexing operations, because the object may be a constrained subtype or itype with no explicit declaration. Candidate indexing operations are found in the same scope and list of declarations as the declaration of the base type. From-SVN: r279432
2019-12-16[Ada] Prototype implementastion of Ada2020 Map-reduce constructEd Schonberg10-5/+371
2019-12-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * scng.adb (Scan): In Ada2020, a left-bracket indicates the start of an homogenous aggregate. * par-ch4.adb (P_Reduction_Attribute_Reference): New procedure. (P_Aggregate): Recognize Ada2020 bracket-delimited aggregates. (P_Primary): Ditto. * par-util.adb (Comma_Present): Return false on a right bracket in Ada2020, indicating the end of an aggregate. * snames.ads-tmpl: Introduce Name_Reduce and Attribute Reduce. * sinfo.ads, sinfo.adb (Is_Homogeneous_Aggregate): New flag on aggregates, to designate an Ada2020 array or container aggregate that is bracket-delimited in the source. * sem_attr.adb (Analyze_Attribute): For attribute Reduce, verify that two arguments are present, and verify that the prefix is a stream or an object that is iterable (array or contrainer). (Resolve_Attribute): For attribute Reduce, resolve initial value with the type of the context. Type-checking of element type of prefix is performed after expansion. * exp_attr.adb (Expand_N_Attribute_Reference): For attribute Reduce, expand into a loop: a) If prefix is an aggregate with a single iterated component association, use its iterator specification to construct a loop, b) If prefix is a name, build a loop using an element iterator loop. * scans.ads: Add brackets tokens. From-SVN: r279431
2019-12-16[Ada] AI12-0001: Independence and Representation clauses for atomic objectsEric Botcazou10-267/+388
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust calls to validate_size. (gnat_to_gnu_component_type): Likewise. (gnat_to_gnu_field): Likewise and pass string for error messages. (components_need_strict_alignment): Remove test on Is_Aliased and add test for the independence of the component. (validate_size): Add S1 and S2 string parameters and use them to give better error messages for fields. Tweak a couple of messages. * einfo.ads (Has_Independent_Components): Document more cases. (Is_Independent): Likewise. (Strict_Alignment): Document new semantics. * exp_ch9.adb (Install_Private_Data_Declarations): Also set the Is_Independent flag along with Is_Aliased on the renaming entity. * freeze.adb (Size_Known): Remove always-false test and add test for the strict-alignment on the record type. Remove redundant tests and add test for the strict-alignment on the component type. (Check_Strict_Alignment): Set the flag if the type is by-ref and remove now redundant conditions. Set the flag on an array type if it has aliased components. In the record type case, do not set type for C_Pass_By_Copy convention. (Freeze_Array_Type): Move code checking for conflicts between representation aspects and clauses to before specific handling of packed array types. Give a warnind instead of an error for a conflict with pragma Pack. Do not test Has_Pragma_Pack for the specific handling of packed array types. (Freeze_Record_Type): Move error checking of representation clause to... (Freeze_Entity): ...here after Check_Strict_Alignment is called. * sem_aggr.adb (Array_Aggr_Subtype): Also set the Is_Independent flag along with Is_Aliased on the Itype. * sem_ch13.adb (Check_Record_Representation_Clause): Do not set the RM size for a strict-alignment type. * sem_ch3.adb (Add_Interface_Tag_Components): Also set the Is_Independent flag along with Is_Aliased on the tag. (Add_Interface_Tag_Components): Likewise on the offset. (Analyze_Component_Declaration): Likewise on the component. (Analyze_Object_Declaration): Likewise on the object. (Constrain_Array): Likewise on the array. (Record_Type_Declaration: Likewise on the tag. (Array_Type_Declaration): Also set the Has_Independent_Components flag along with Has_Aliased_Components on the array. (Copy_Array_Base_Type_Attributes): Copy Has_Independent_Components. (Copy_Array_Subtype_Attributes): Copy Is_Atomic, Is_Independent and Is_Volatile_Full_Access. (Analyze_Iterator_Specification): Set Is_Independent on the loop variable according to Independent_Components on the array. * sem_ch5.adb: Likewise. * sem_ch6.adb (Process_Formals): Also set the Is_Independent flag along with Is_Aliased on the formal. gcc/testsuite/ * gnat.dg/specs/clause_on_volatile.ads, gnat.dg/specs/size_clause3.ads: Update expected diagnostics. From-SVN: r279430
2019-12-16[Ada] Fully propagate representation aspects through renamingEric Botcazou5-134/+216
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch8.adb (Analyze_Object_Renaming): Set Atomic, Independent and Volatile_Full_Access aspects on the entity of the renaming the same way as the Volatile aspect is set. * sem_util.ads (Is_Atomic_Object_Entity): Move declaration to... (Is_Independent_Object): New function. (Is_Volatile_Full_Access_Object): Likewise. * sem_util.adb (Is_Atomic_Object_Entity): ...here. (Prefix_Has_Atomic_Components): Minor tweak. (Is_Atomic_Object): Test Is_Atomic on the Etype uniformly. (Is_Atomic_Or_VFA_Object): Call Is_Volatile_Full_Access_Object. (Is_Independent_Object): New predicate. (Is_Subcomponent_Of_Atomic_Object): Remove redundant test. (Is_Volatile_Full_Access_Object): New predicate. (Is_Volatile_Prefix): Rename into... (Prefix_Has_Volatile_Components): ... and call Is_Volatile_Object. (Object_Has_Volatile_Components): Delete. (Is_Volatile_Object): Simplify. * gcc-interface/trans.c (node_is_volatile_full_access): Adjust comment. From-SVN: r279429
2019-12-16[Ada] Syntax error on improperly indented imported subprogramBob Duff13-187/+232
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * par.adb: Add Scopes function to do range checking on the scope stack. Call Scopes all over the parser. Add SIS_Aspect_Import_Seen flag. * par-ch6.adb (P_Subprogram): Initialize SIS_Aspect_Import_Seen to False at the start, and check it at the end. * par-ch13.adb (Get_Aspect_Specifications): Set SIS_Aspect_Import_Seen to True when appropriate. * par-ch10.adb, par-ch12.adb, par-ch2.adb, par-ch3.adb, par-ch5.adb, par-ch7.adb, par-ch9.adb, par-endh.adb, par-util.adb: Call Scopes. From-SVN: r279428
2019-12-16[Ada] Fix couple of oversights in the implementation of AI12-0128Eric Botcazou4-143/+203
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_prag.adb (Atomic_Components): Remove local variable and fix consistency issues. Call Component_Type on the Etype of E. (Independent_Components): Remove local variable. * sem_util.adb (Is_Subcomponent_Of_Atomic_Object): Properly deal with prefixes that are access values. * gcc-interface/trans.c (atomic_acces_t): New enumeral type. (node_is_atomic) <N_Indexed_Component>: Test the prefix. (node_has_volatile_full_access): Rename into... (node_is_volatile_full_access): ...this. (node_is_component): New predicare. (gnat_strip_type_conversion): Delete. (outer_atomic_access_required_p): Likewise. (atomic_access_required_p): Rename into... (get_atomic_access): ...this. Implement the 3 different semantics of Atomic and Volatile_Full_Access. (simple_atomic_access_required_p): New predicate. (Call_to_gnu): Remove outer_atomic_access parameter and change the type of atomic_access parameter to atomic_acces_t. Replace call to atomic_access_required_p with simple_atomic_access_required_p for the in direction and call get_atomic_access for the out direction instead of [outer_]atomic_access_required_p. (lhs_or_actual_p): Constify local variables. (present_in_lhs_or_actual_p): Likewise. (gnat_to_gnu) <N_Identifier>: Replace call to atomic_access_required_p with simple_atomic_access_required_p. <N_Explicit_Dereference>: Likewise. <N_Indexed_Component>: Likewise. <N_Selected_Component>: Likewise. <N_Assignment_Statement>: Call get_atomic_access for the name instead of [outer_]atomic_access_required_p. Adjust call to Call_to_gnu. <N_Function_Call>: Adjust call to Call_to_gnu. (get_controlling_type): Fix typo in comment. From-SVN: r279427
2019-12-16[Ada] Export the Ada version through the C interfaceEric Botcazou3-2/+22
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * fe.h (Ada_Version_Type): New typedef. (Ada_Version): Declare. * opt.ads (Ada_Version_Type): Add Convention C and WARNING line. (Ada_Version): Add WARNING line. (Exception_Mechanism_Type): Likewise. From-SVN: r279426
2019-12-16[Ada] Minor reformatting and U.S. spelling adjustmentGary Dismukes3-12/+16
2019-12-16 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * checks.adb, sem_util.adb: Minor reformatting and U.S. spelling adjustment. From-SVN: r279425
2019-12-16[Ada] Better error message for "is null" subunitBob Duff2-0/+20
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * sem_ch10.adb (Analyze_Subunit): Give an error if the subunit is not a proper body. This hides the confusing "duplicate body" message that was previously given. From-SVN: r279424
2019-12-16[Ada] Expand renamings of subcomponents of an atomic or VFA objectEric Botcazou2-5/+25
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Document third special case of renamings requiring special handling. (Evaluation_Required): Return true for an atomic or VFA prefix. From-SVN: r279423
2019-12-16[Ada] Crash on conversion in branch of if-expressionEd Schonberg2-1/+26
2019-12-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * checks.adb (Apply_Float_Conversion_Check): Use node of type conversion and not its parent, when inserting the declaration for the temporary that hold the result of the conversion. Previously the declaration was inserted above the parent of the conversion, apparently as a small optimization for the subsequent traversal in Insert_Actions. Unfortunately a similar optimization takes place in Insert_Actions, assuming that the insertion point must be above the expression that creates the actions to insert. This is not correct in the presence of conditional expressions (i.e. since Ada2012), where the insertion must be in the list of actions attached to the current alternative. From-SVN: r279422
2019-12-16[Ada] Bad warning: Size in Compile_Time_Error in nested instanceBob Duff2-2/+12
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute): Use Known_RM_Size. But we still need Size_Known_At_Compile_Time, because when the size really is known, sometimes only one or the other of these is True. From-SVN: r279421
2019-12-16[Ada] Small consistency fix for Volatile_Full_Access objectsEric Botcazou3-7/+51
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_util.adb (Is_Atomic_Or_VFA_Object): Also return true for components whose type is Volatile_Full_Access or which are subject to the aspect/pragma individually. * sem_util.ads (Is_Atomic_Object_Entity): Small comment fix. From-SVN: r279420
2019-12-16[Ada] Do not issue restriction violations on ignored ghost codeYannick Moy3-3/+16
2019-12-16 Yannick Moy <moy@adacore.com> gcc/ada/ * exp_ch6.adb: Fix comment. * sem_res.adb (Resolve_Call): Do not check No_Recursion restriction or indirectly No_Secondary_Stack restriction, when inside an ignored ghost subprogram. From-SVN: r279419
2019-12-16[Ada] AI12-0208 Support for Ada.Numerics.Big_Numbers.Big_Integers and Big_RealsArnaud Charlet13-1100/+3454
2019-12-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * impunit.adb: Add a-nbnbin, a-nbnbre, a-nubinu to Ada 2020 units. * Makefile.rtl: Enable new file. * libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads, libgnat/a-nbnbre.adb, libgnat/a-nbnbre.ads, libgnat/a-nubinu.ads: New files. Provide default standalone implementation of Ada.Numerics.Big_Numbers.Big_* based on System.Generic_Bignum. * libgnat/a-nbnbin__gmp.adb: Alternate implementation of Ada.Numerics.Big_Numbers.Big_Integers based on GMP. Not enabled for now. * libgnat/s-bignum.ads, libgnat/s-bignum.adb: Now a simple wrapper on top of s-genbig.ads. * libgnat/s-genbig.ads, libgnat/s-genbig.adb: New files, making s-bignum generic for reuse in Ada.Numerics.Big_Numbers. From-SVN: r279418
2019-12-16[Ada] Correct documentation of -gnatw_C switchBob Duff3-2/+8
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Correct documentation of -gnatw_C switch * gnat_ugn.texi: Regenerate. From-SVN: r279417
2019-12-16[Ada] Reword the impact of -minimal on the debuggerJoel Brobecker3-2/+15
2019-12-16 Joel Brobecker <brobecker@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (_Switches_for_gnatbind): Reword the section explaining the impact of -minimal on debugging. * gnat_ugn.texi: Regenerate. From-SVN: r279416
2019-12-16[Ada] Typo fixes and minor reformattingGary Dismukes3-8/+17
2019-12-16 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * libgnat/g-exptty.adb, libgnat/g-exptty.ads: Typo fixes and minor reformatting. From-SVN: r279415
2019-12-16[Ada] Implement RM C.6(19) clause entirely in the front-endEric Botcazou5-76/+68
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): New predicate. (Expand_Actuals): Use it to decide whether to add call by copy code as per the RM C.6(19) clause. * fe.h (Is_Atomic_Object): Remove. (Is_Volatile_Object): Likewise. * sem_util.ads (Is_Atomic_Object): Remove WARNING note. (Is_Volatile_Object): Likewise. * gcc-interface/trans.c (atomic_or_volatile_copy_required_p): Delete. (Call_to_gnu): Do not implement the RM C.6(19) clause. From-SVN: r279414
2019-12-16[Ada] Validate_Access_Subprogram_Instance: check if not null types matchGhjuvan Lacambre2-0/+11
2019-12-16 Ghjuvan Lacambre <lacambre@adacore.com> gcc/ada/ * sem_ch12.adb (Validate_Access_Subprogram_Instance): Add Can_Never_Be_Null checks. From-SVN: r279413
2019-12-16[Ada] Implement new legality rules introduced in C.6(13) by AI12-0128Eric Botcazou9-161/+394
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (VFA): Document extension of the no-aliasing rule to any subcomponent. * freeze.adb (Freeze_Object_Declaration): Small comment tweak. (Freeze_Record_Type): Do not deal with delayed aspect specifications for components here but... (Freeze_Entity): ...here instead. * sem_ch12.adb (Instantiate_Object): Improve wording of errors given for legality rules in C.6(12) and implement the new rule in C.6(13). * sem_res.adb (Resolve_Actuals): Likewise. * sem_prag.adb (Check_Atomic_VFA): New procedure implementing the new legality rules in C.6(13). (Process_Atomic_Independent_Shared_Volatile): Call Check_Atomic_VFA to check the legality rules. Factor out code marking types into... (Mark_Type): ...this new procedure. (Check_VFA_Conflicts): Do not check the legality rules here. (Pragma_Atomic_Components): Call Check_Atomic_VFA on component type. * sem_util.ads (Is_Subcomponent_Of_Atomic_Object): Declare. * sem_util.adb (Is_Subcomponent_Of_Atomic_Object): New predicate. * gnat_rm.texi: Regenerate. From-SVN: r279412
2019-12-13[Ada] Minor rewording of one sentenceGary Dismukes3-4/+10
2019-12-13 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Minor rewording of one sentence. * gnat_rm.texi: Regenerate. From-SVN: r279368
2019-12-13[Ada] Unnesting and annex EArnaud Charlet2-2/+10
2019-12-13 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_unst.adb (Unnest_Subprogram): Account for trees produced by Annex E constructs. From-SVN: r279367
2019-12-13[Ada] implementation_defined_pragmas.rst: Update Initialize_Scalars docsGhjuvan Lacambre3-4/+14
2019-12-13 Ghjuvan Lacambre <lacambre@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Update Initialize_Scalars documentation. * gnat_rm.texi: Regenerate. From-SVN: r279366
2019-12-13[Ada] Spurious error on precondition of subprogram instantiationJavier Miranda2-1/+12
2019-12-13 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specification): Processing a precondition, if the expression is of the form A and then B, do not generate separate Pre/Post aspects for the separate clases when we are processing a generic unit. Required to avoid reporting spurious visibility errors on the instantiations. From-SVN: r279365
2019-12-13[Ada] Better error message for aliased formal and atomic actualEric Botcazou2-1/+7
2019-12-13 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Actuals): Give canonical error for illegal case of atomic/volatile parameter also if the formal is aliased. From-SVN: r279364
2019-12-13[Ada] Clear confusion about subcomponents of atomic objectEric Botcazou3-37/+26
2019-12-13 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_util.ads (Is_Atomic_Object): Mention relevant RM clauses. * sem_util.adb (Is_Atomic_Object): For an indexed component, only look at the Has_Atomic_Components aspect of the prefix and do not recurse on it; for a selected component, do not look at the prefix. (Is_Atomic_Or_VFA_Object): Minor tweak. From-SVN: r279363
2019-12-13[Ada] Fix support for > 24 hours image in Ada.Calendar.FormattingArnaud Charlet3-19/+51
2019-12-13 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-calfor.ads, libgnat/a-calfor.adb (Split_Duration): New procedure. (Split, Image): Use Split_Duration. Update Image spec. From-SVN: r279362
2019-12-13[Ada] Adding support for unsupported type conversions in CCGJavier Miranda2-0/+18
2019-12-13 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_unst.adb (Unnest_Subprogram): Generate an extra temporary to facilitate the C backend processing dereferences. From-SVN: r279361
2019-12-13[Ada] Pragma Linker_Section in subprogram instantiations in CCGJavier Miranda2-0/+26
2019-12-13 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Pragma): Propagate the Linker_Section_Attribute to the ultimate alias of the subprogram to facilitate the C backend processing this attribute. From-SVN: r279360
2019-12-13[Ada] Avoid spurious mismatch error of assertion policy in genericsYannick Moy2-3/+11
2019-12-13 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_util.adb (Original_Aspect_Pragma_Name): Go through Original_Node for pragma. From-SVN: r279359
2019-12-13[Ada] Minor fix typo in commentPiotr Trojanek3-2/+6
2019-12-13 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_aggr.adb, exp_unst.adb: Minor fix typo in comment. From-SVN: r279358
2019-12-13[Ada] Detect illegal implicit type conversionsSteve Baird2-2/+7
2019-12-13 Steve Baird <baird@adacore.com> gcc/ada/ * sem_res.adb (Resolve, Valid_Conversion): Add Base_Type call when testing whether a type is a general access type. From-SVN: r279357
2019-12-13[Ada] Adding support for unsupported type conversion in CCGJavier Miranda2-0/+26
2019-12-13 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Unchecked_Type_Conversion): Generate an extra temporary for cases unsupported by the C backend. From-SVN: r279356
2019-12-13[Ada] Implement AI12-0109 (prohibit some "early" derivations)Steve Baird4-25/+129
2019-12-13 Steve Baird <baird@adacore.com> gcc/ada/ * einfo.ads: Correct comment for Derived_Type_Link to reflect that fact that this function is now used for more than just generation of warnings. * sem_ch3.adb (Build_Derived_Type): Do not call Set_Derived_Type_Link if the derived type and the parent type are in different compilation units. Such a derivation cannot be a problematic "early" derivation (identifying these is what the Derived_Type_Link attribute is used for) and we don't like inter-unit references that go in the opposite direction of semantic dependencies. * sem_ch13.adb (Is_Type_Related_Rep_Item): A new function, analogous to the existing function Is_Operational_Item. (Rep_Item_Too_Late): Generate a hard error (with same text as the warning that was previously being generated) if the AI12-0109 legality rule is violated. From-SVN: r279355
2019-12-13[Ada] Minor tweak to Volatile_Full_Access wording in GNAT RMEric Botcazou3-7/+13
2019-12-13 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Minor tweak to Volatile_Full_Access wording in GNAT RM. * gnat_rm.texi: Regenerate. From-SVN: r279354
2019-12-13[Ada] Suppress Base_Address call on init of activation record componentsGary Dismukes2-1/+38
2019-12-13 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference, Attribute_Address): Suppress generation of a call to Base_Address in the case where the Address attribute is being used to initialize a corresponding component of an activation record. (Is_Unnested_Component_Init): New function to determine whether an attribute reference for Address is used to initialized a component of an activation record object that corresponds to the object denoted by the prefix of the attribute (an assignment used in support of unnesting for back ends like LLVM). From-SVN: r279353
2019-12-13[Ada] Crash on implicit dereference not made explicitEd Schonberg2-5/+42
2019-12-13 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_res.adb (Resolve): IF an entity reference is overloaded because its type has an Implicit_Dereference aspect, we must examine the discriminants of the type to determine whether an explicit dereference must be inserted for use in code generation. Previously this was done for other expressions but not for entity references by themselves. This was sufficient to handle uses of the aspect in container handling and iteration, but not more generally. From-SVN: r279352
2019-12-13[Ada] Deallocation of controlled type implementing interface typesJavier Miranda6-13/+88
2019-12-13 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_disp.ads (Expand_Interface_Thunk): Adding one formal (the interface type). * exp_disp.adb (Expand_Interface_Thunk): Using the added formal to ensure the correct profile of the thunk generated for predefined primitives; in addition, the added formal is also used to perform a check that ensures that the controlling type of the thunk is the one expected by the GCC backend. (Make_Secondary_DT, Register_Primitive): Adding the new formal to the calls to Expand_Interface_Thunk. * exp_ch6.adb (Register_Predefined_DT_Entry): Adding the new formal to the call to Expand_Interface_Thunk. * exp_intr.adb (Expand_Unc_Deallocation): When deallocating a controlled type and the call to unchecked deallocation is performed with a pointer to one of the convered interface types, displace the pointer to the object to reference the base of the object to deallocate its memory. * gcc-interface/trans.c (maybe_make_gnu_thunk): Assert that the controlling type of the thunk is an interface type. From-SVN: r279351
2019-12-13[Ada] Remove Is_Available functionBob Duff2-66/+47
2019-12-13 Bob Duff <duff@adacore.com> gcc/ada/ * exp_attr.adb (Is_Available): Remove this function, and replace all calls with RTE_Available. RTE_Available will return True if "not Configurable_Run_Time_Mode". Remove the "???" comment. From-SVN: r279350
2019-12-13[Ada] Crash on inherited private operation in child packageEd Schonberg2-0/+12
2019-12-13 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch7.adb (Analyze_Package_Body_Helper): Do not call Declare_Inherited_Private_Subprograms on s child body: the required operations have already been created when analyzing the corresponding package declaration. This prevents a redeclaration of inehrited operation, and a crash when inserting the new operation in the current scope. From-SVN: r279349