aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2020-10-19[Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def typesBob Duff61-43/+904
gcc/ada/ * exp_put_image.adb (Build_Elementary_Put_Image_Call): Use the base type to recognize various cases of access types. * 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-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-coboho.adb, libgnat/a-coboho.ads, libgnat/a-cobove.adb, libgnat/a-cobove.ads, libgnat/a-cohama.adb, libgnat/a-cohama.ads, libgnat/a-cohase.adb, libgnat/a-cohase.ads, libgnat/a-coinho.adb, libgnat/a-coinho.ads, libgnat/a-coinho__shared.adb, libgnat/a-coinho__shared.ads, libgnat/a-coinve.adb, libgnat/a-coinve.ads, libgnat/a-comutr.adb, libgnat/a-comutr.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, libgnat/a-strunb.adb, libgnat/a-strunb.ads, libgnat/a-strunb__shared.adb, libgnat/a-strunb__shared.ads: Implement Put_Image attibute. * libgnat/a-stteou.ads, libgnat/s-putima.ads, libgnat/a-stouut.ads, libgnat/a-stoubu.adb: Make Ada.Strings.Text_Output, Ada.Strings.Text_Output.Utils, and System.Put_Images Pure, so they can be with'ed by Pure units that should have Put_Image defined. * libgnat/a-stouut.adb: Add missing column adjustments, and remove a redundant one. * libgnat/s-putima.adb (Put_Arrow): New routine to print an arrow. Avoids adding a with clause to some containers.
2020-10-19[Ada] Ada2020: matching parentheses and bracketsBob Duff3-13/+34
gcc/ada/ * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Require matching parens or brackets. * par.adb, par-tchk.adb (T_Right_Bracket): New procedure to give an error on missing ].
2020-10-19[Ada] Crash in expression function defined in protected objectJavier Miranda1-0/+17
gcc/ada/ * sem_ch8.adb (Find_Direct_Name): Do not trust in the decoration of the Entity attribute in constants associated with discriminals of protected types.
2020-10-19[Ada] AI12-0170: Abstract subprogram calls in class-wide precond exprsGary Dismukes1-2/+6
gcc/ada/ * sem_disp.adb (Check_Dispatching_Context): When the enclosing subprogram is abstract, bypass early return if the call is tag-indeterminate, to continue with the later error checking.
2020-10-19[Ada] Private type unexpectedly visibleJavier Miranda1-0/+19
gcc/ada/ * sem_ch7.adb (Uninstall_Declarations): Uninstall the declaration of a subtype declaration defined in the private part of a package.
2020-10-19[Ada] Clean up support of square bracketsArnaud Charlet2-4/+9
gcc/ada/ * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Simplify code since we are always under -gnatX if we encounter a Tok_Left_Bracket. * scng.adb (Scan): [] is an aggregate under -gnatX and a wide character otherwise.
2020-10-19[Ada] Remove useless initialization and refine type of a local variablePiotr Trojanek1-1/+1
gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Cleanup.
2020-10-19[Ada] Refine type of a local variablePiotr Trojanek1-1/+1
gcc/ada/ * exp_ch6.adb (Is_Direct_Deep_Call): Refine type from Node_Id to Entity_Id.
2020-10-19[Ada] Simplify membership test for operatorsPiotr Trojanek1-3/+1
gcc/ada/ * exp_ch6.adb (May_Fold): Detect all operators, i.e. both binary and unary ones.
2020-10-19[Ada] Simplify repeated calls with membership testPiotr Trojanek1-2/+2
gcc/ada/ * inline.adb (Expand_Inlined_Call): Simplify repeated calls to Nkind.
2020-10-19Daily bump.GCC Administrator1-0/+32
2020-10-18revamp ada.numerics.auxAlexandre Oliva15-477/+598
Instead of mapping elementary functions for all types to a single type, use the intrinsics available for the various base types. A new Ada.Numerics.Aux_Generic_Float is introduced to explicitly dispatch, based on the 'Digits attribute of the base type, to the various newly-added Aux_Short_Float, Aux_Float, Aux_Long_Float, or Aux_Long_Long_Float. The Aux_Short_Float unit is implemented in terms of the Aux_Float one, and the others rely on the elementary functions from the C Math library for float, double and long double types, respectively. An Aux_Linker_Options is added, and units that import intrinsics from libm/libc depend on it to provide the "-lm" linker option if needed. The option is provided by default, but there is an alternate version that doesn't, that is used for vxworks targets. The Aux variant that used to open-code Sin and Cos for the ancient ppc-darwin, because of insufficient precision in libc, is dropped, along with the alternate dummy body for Aux. Both are presumed no longer needed. The original Ada.Numerics.Aux is retained, for backward compatibility, as a wrapper for a newly-added Aux_Compat, that renames Aux_Long_Float, except on x86, in which an alternate version renames Aux_Long_Long_Float. Generic_Elementary_Functions and Generic_Complex_Types are adjusted to use Aux_Generic_Float, avoiding the type conversions and inefficiencies of computing results in higher precision than requested. Generic_Complex_Elementary_Functions is adjusted to enable an additional instance of the sincos optimization, even without -gnatn. for gcc/ada/ChangeLog * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Compile Ada.Numerics child units Aux_Generic_Float, Aux_Long_Long_Float, Aux_Long_Float, Aux_Float, Aux_Short_Float, Aux_Compat, and Aux_Linker_Options. (X86_TARGET_PAIRS): Drop dummy body for Aux. Use x86 version of Aux_Compat. (X86_64_TARGET_PAIRS): Likewise. (LIBGNAT_TARGET_PAIRS): On VxWorks, select the nolibm variants. Drop the darwin version of Aux. Drop the redundant libc-x86 numaux variants on x86* kfreebsd variants. * libgnat/a-nagefl.ads: New Aux_Generic_Float. * libgnat/a-naliop.ads: New Aux_Linker_Options. * libgnat/a-naliop__nolibm.ads: New. * libgnat/a-nallfl.ads: New Aux_Long_Long_Float. * libgnat/a-nalofl.ads: New Aux_Long_Float. * libgnat/a-nuaufl.ads: New Aux_Float. * libgnat/a-nashfl.ads: New Aux_Short_Float. * libgnat/a-ngcefu.adb (Exp): Factor out the Im (X) passed to Sin and Cos in the Complex variant too. * libgnat/a-ngcoty.adb: Switch to Aux_Generic_Float. Drop redundant conversions. * libgnat/a-ngelfu.adb: Likewise. * libgnat/a-nuauco.ads: New Aux_Compat. * libgnat/a-nuauco__x86.ads: New. * libgnat/a-numaux.ads: Replace with Compat wrapper. * libgnat/a-numaux__darwin.adb: Remove. * libgnat/a-numaux__darwin.ads: Remove. * libgnat/a-numaux__dummy.adb: Remove. * libgnat/a-numaux__libc-x86.ads: Remove. * libgnat/a-numaux__vxworks.ads: Remove.
2020-10-17Daily bump.GCC Administrator1-0/+381
2020-10-16[Ada] Assorted style cleanupsPiotr Trojanek12-30/+27
gcc/ada/ * checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch6.adb, freeze.adb, sem_aggr.adb, sem_attr.adb, sem_ch13.adb, sem_ch13.ads, sem_ch6.adb, sem_eval.adb, sem_util.adb: Fix style and typos.
2020-10-16[Ada] Preelaborate rules not fully enforcedArnaud Charlet1-0/+1
gcc/ada/ * sem_cat.adb (Is_Primary): Handle N_Range properly.
2020-10-16[Ada] Implement expansion of CUDA_Execute pragmaGhjuvan Lacambre5-2/+567
gcc/ada/ * elists.ads (New_Elmt_List): New functions. * elists.adb (New_Elmt_List): New functions. * exp_prag.adb: Add dependency on Elists. (Expand_Pragma_CUDA_Execute): New function. (Expand_N_Pragma): Add call to Expand_Pragma_CUDA_Execute. * rtsfind.ads: Add CUDA.Internal, CUDA.Runtime, System.C packages and RE_Push_Call_Configuration, RE_Pop_Call_Configuration, RE_Launch_Kernel, RO_IC_Unsigned, RO_IC_Unsigned_Long_Long entities. * rtsfind.adb: Extend Interfaces_Descendant to include Interfaces_C.
2020-10-16[Ada] Ada2020: parsing of qualified exprs with new agg syntaxBob Duff1-5/+10
gcc/ada/ * par-ch4.adb (P_Name): Allow Tok_Left_Bracket in two places to call P_Qualified_Expression. We don't need to modify other places that call P_Qualified_Expression, because a qualified_expression is a name in Ada 2012 and higher, so P_Name is the right place. The parser already parses aggregates with brackets; we just need to allow that in qualified expressions.
2020-10-16[Ada] Crash in generic renaming declaration of child unitJavier Miranda1-0/+49
gcc/ada/ * sem_ch12.adb (Check_Generic_Child_Unit): When the child unit is a renaming of a generic child unit then traverse the scope containing the renaming declaration to locate the instance of its parent. Otherwise the parent is not installed and the frontend cannot process the instantiation.
2020-10-16[Ada] Remove non-ASCII characterBob Duff1-1/+4
gcc/ada/ * libgnat/a-numeri.ads: Remove the greek letter.
2020-10-16[Ada] Attribute Img on derived typesEd Schonberg1-2/+8
gcc/ada/ * exp_imgv.adb (Expand_Image_Attribute): Refine previous patch to use root type (and not base type) on enumeration types.
2020-10-16[Ada] Attribute Img on derived typesEd Schonberg1-12/+8
gcc/ada/ * exp_imgv.adb (Expand_Image_Attribute): Use the base type instead of the root type when type of object is private. Remove Ada_2020 guard, because it has been checked during prior analysis. Use Underlying_Type in all cases, as it is a no-op on types that are not private.
2020-10-16[Ada] Ada2020: AI12-0129 Make protected objects more protectingArnaud Charlet4-4/+34
gcc/ada/ * aspects.ads, snames.ads-tmpl: Add support for Exclusive_Functions aspect. * sem_ch13.adb (Analyze_Aspect_Specifications): Ditto. * exp_ch9.adb (Build_Protected_Subprogram_Body): Take aspect Exclusive_Functions into account.
2020-10-16[Ada] Clean up in system.ads dependencies during compiler buildArnaud Charlet2-5/+6
gcc/ada/ * gcc-interface/Make-lang.in: Update dependencies on system.ads, add gnatbind switch -t to avoid timestamp inconsistencies during build. * libgnat/system.ads: Move... * gcc-interface/system.ads: ... here.
2020-10-16[Ada] Legal actual type with inherited discriminants rejected in instantiationGary Dismukes1-2/+59
gcc/ada/ * sem_eval.adb (Subtypes_Statically_Match): Retrieve discriminant constraints from the two types via new function Original_Discriminant_Constraint rather than Discriminant_Constraint. (Original_Discriminant_Constraint): New function to locate the nearest explicit discriminant constraint associated with a type that may possibly have inherited a constraint from an ancestor type.
2020-10-16[Ada] Remove obsolete workaround regarding array returnsBob Duff1-8/+1
gcc/ada/ * exp_ch6.adb (Expand_Simple_Function_Return): Remove obsolete comment and code.
2020-10-16[Ada] Convert from UTF_16 to UTF_8 fails for large valuesArnaud Charlet1-1/+1
gcc/ada/ PR ada/95953 * libgnat/a-suenco.adb (Convert): Fix handling of third UTF-8 byte.
2020-10-16[Ada] Avoid premature finalization of a function resultSteve Baird1-1/+6
gcc/ada/ * exp_util.adb (Is_Related_To_Func_Return): Cope with the case where the FE introduces a type conversion.
2020-10-16[Ada] Constants no longer synchronised if they are access-to-variableChris Martin2-3/+19
gcc/ada/ * sem_util.ads, sem_util.adb (Is_Access_Variable): New function. (Is_Synchronized_Object): Call new function when determining if a constant can be regarded as synchronized.
2020-10-16[Ada] Finalization of uninitialized object with build in place callArnaud Charlet2-5/+13
gcc/ada/ * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Call Set_BIP_Initialization_Call systematically. * exp_ch7.adb (Process_Transient_In_Scope): Take BIP_Initialization_Call into account to decide where to insert the Hook.
2020-10-16[Ada] Detect qualified type names for AI12-0027Piotr Trojanek2-2/+2
gcc/ada/ * sem_util.adb (Is_View_Conversion): Detect qualified types. * sem_util.ads (Is_Actual_In_Out_Parameter): Fix style in comment.
2020-10-16[Ada] Relax too strong assertionsArnaud Charlet2-2/+2
gcc/ada/ * scil_ll.adb, sem_scil.adb: Update assertions.
2020-10-16[Ada] Improvements to implementation of Ada_2020 attribute ReduceEd Schonberg2-22/+98
gcc/ada/ * sem_attr.adb (Min_Max): Handle the case where attribute name (qualified by required type) appears as the reducer of a 'Reduce attribute reference. (Resolve_Attribute) <Reduce>: Handle properly the presence of a procedure or an attribute reference Min/Max as a reducer. * exp_attr.adb (Expand_Attribute_Reference) <Reduce>: New subprogram Build_Stat, to construct the combining statement which appears in the generated loop for Reduce, and which is either a function call when the reducer is a function or an attribute, or a procedure call when reducer is an appropriate procedure. BuilD_Stat is used both when the prefix of 'Reduce is a value sequence and when it is an object
2020-10-16[Ada] Reduce use of primary stack on string concatenationArnaud Charlet1-23/+91
gcc/ada/ * exp_ch4.adb (Expand_Concatenate): Allocate result of string concatenation on secondary stack when relevant.
2020-10-16[Ada] Spurious visibility error on Declare_Expression with renamesEd Schonberg1-1/+4
gcc/ada/ * sem_res.adb (Resolve_Declare_Expression): Retrieve the created block entity that is the scope of the local declarations, from either a local object declaration or an object renaming declaration. The block entity does not have an explicit declaration, but appears as the scope of all locally declared objects.
2020-10-16[Ada] Use new Max_Integer_Size attribute in system.ads filesEric Botcazou63-195/+195
gcc/ada/ * libgnat/system-aix.ads: Likewise. * libgnat/system-darwin-arm.ads: Likewise. * libgnat/system-darwin-ppc.ads: Likewise. * libgnat/system-darwin-x86.ads: Likewise. * libgnat/system-djgpp.ads: Likewise. * libgnat/system-dragonfly-x86_64.ads: Likewise. * libgnat/system-freebsd.ads: Likewise. * libgnat/system-hpux-ia64.ads: Likewise. * libgnat/system-hpux.ads: Likewise. * libgnat/system-linux-alpha.ads: Likewise. * libgnat/system-linux-arm.ads: Likewise. * libgnat/system-linux-hppa.ads: Likewise. * libgnat/system-linux-ia64.ads: Likewise. * libgnat/system-linux-m68k.ads: Likewise. * libgnat/system-linux-mips.ads: Likewise. * libgnat/system-linux-ppc.ads: Likewise. * libgnat/system-linux-riscv.ads: Likewise. * libgnat/system-linux-s390.ads: Likewise. * libgnat/system-linux-sh4.ads: Likewise. * libgnat/system-linux-sparc.ads: Likewise. * libgnat/system-linux-x86.ads: Likewise. * libgnat/system-lynxos178-ppc.ads: Likewise. * libgnat/system-lynxos178-x86.ads: Likewise. * libgnat/system-mingw.ads: Likewise. * libgnat/system-qnx-aarch64.ads: Likewise. * libgnat/system-rtems.ads: Likewise. * libgnat/system-solaris-sparc.ads: Likewise. * libgnat/system-solaris-x86.ads: Likewise. * libgnat/system-vxworks-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks-arm-rtp.ads: Likewise. * libgnat/system-vxworks-arm.ads: Likewise. * libgnat/system-vxworks-e500-kernel.ads: Likewise. * libgnat/system-vxworks-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks-e500-rtp.ads: Likewise. * libgnat/system-vxworks-e500-vthread.ads: Likewise. * libgnat/system-vxworks-ppc-kernel.ads: Likewise. * libgnat/system-vxworks-ppc-ravenscar.ads: Likewise. * libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks-ppc-rtp.ads: Likewise. * libgnat/system-vxworks-ppc-vthread.ads: Likewise. * libgnat/system-vxworks-ppc.ads: Likewise. * libgnat/system-vxworks-x86-kernel.ads: Likewise. * libgnat/system-vxworks-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks-x86-rtp.ads: Likewise. * libgnat/system-vxworks-x86-vthread.ads: Likewise. * libgnat/system-vxworks-x86.ads: Likewise. * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-aarch64.ads: Likewise. * libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-arm.ads: Likewise. * libgnat/system-vxworks7-e500-kernel.ads: Likewise. * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-e500-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc64-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-kernel.ads: Likewise. * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-rtp.ads: Likewise. * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise. * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2020-10-16[Ada] Remove support for -gnatP and pragma PollingArnaud Charlet78-572/+5
gcc/ada/ * Makefile.rtl, gnat1drv.adb, expander.adb doc/gnat_rm/implementation_defined_pragmas.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/the_gnat_compilation_model.rst, exp_ch5.ads, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_util.adb, exp_util.ads, libgnarl/s-osinte__aix.adb, libgnarl/s-osinte__android.adb, libgnarl/s-osinte__darwin.adb, libgnarl/s-osinte__gnu.adb, libgnarl/s-osinte__hpux-dce.adb, libgnarl/s-osinte__lynxos178.adb, libgnarl/s-osinte__posix.adb, libgnarl/s-osinte__qnx.adb, libgnarl/s-osinte__rtems.adb, libgnarl/s-osinte__solaris.adb, libgnarl/s-osinte__vxworks.adb, libgnarl/s-osinte__x32.adb, libgnarl/s-solita.adb, libgnarl/s-taasde.adb, libgnarl/s-taprob.adb, libgnarl/s-taprop__dummy.adb, libgnarl/s-taprop__hpux-dce.adb, libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb, libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb, libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb, libgnarl/s-tarest.adb, libgnarl/s-tasini.adb, libgnarl/s-taskin.adb, libgnarl/s-taspri__dummy.ads, libgnarl/s-taspri__hpux-dce.ads, libgnarl/s-taspri__lynxos.ads, libgnarl/s-taspri__mingw.ads, libgnarl/s-taspri__posix-noaltstack.ads, libgnarl/s-taspri__posix.ads, libgnarl/s-taspri__solaris.ads, libgnarl/s-taspri__vxworks.ads, libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb, libgnarl/s-tposen.adb, libgnat/a-except.adb, libgnat/a-except.ads, libgnat/s-dwalin.adb, libgnat/s-dwalin.ads, libgnat/s-mastop.ads, libgnat/s-soflin.adb, libgnat/s-stalib.adb, libgnat/s-stalib.ads, libgnat/s-stchop.adb, libgnat/s-stchop.ads, libgnat/s-stchop__limit.ads, libgnat/s-traceb.ads, libgnat/s-traent.adb, libgnat/s-traent.ads, libgnat/s-trasym.adb, libgnat/s-trasym.ads, libgnat/s-trasym__dwarf.adb, opt.adb, opt.ads, par-prag.adb, sem_prag.adb, snames.ads-tmpl, switch-c.adb, targparm.adb, targparm.ads, usage.adb: Remove support for -gnatP and pragma Polling. * gnat_ugn.texi: Regenerate. * libgnat/a-excpol.adb, libgnat/a-excpol__abort.adb: Removed.
2020-10-16[Ada] Unique itypes names for unconstrained array object declarationPiotr Trojanek1-1/+6
gcc/ada/ * sem_ch3.adb (Array_Type_Declaration): Create itype with unique name.
2020-10-16[Ada] Cleanup related to itypes for unconstrained object declarationPiotr Trojanek1-21/+15
gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Limit scope of a local object by hiding it from local subprograms; simplify nested if-then-if-then condition for an Ada 83 restriction. (Array_Type_Declaration): Confirm with assertion when the else branch is executed. (Find_Type_Of_Object): Simplify membership test with a subtype range.
2020-10-16[Ada] SPARK: update for effectively volatile types and objectsYannick Moy4-43/+149
gcc/ada/ * sem_prag.adb (Analyze_Global_In_Decl_Part): Update check to reject volatile object for reading. * sem_res.adb (Resolve_Actuals, Resolve_Entity_Name): Update check to reject volatile object for reading. * sem_util.adb, sem_util.ads (Check_Nonvolatile_Function_Profile, Has_Effectively_Volatile_Profile): Detect use of volatile object for reading. (Has_Enabled_Property): Accept constants as well. (Is_Effectively_Volatile_For_Reading): New function based on existing Is_Effectively_Volatile. (Is_Effectively_Volatile_Object_For_Reading): Adapted from the existing Is_Effectively_Volatile_Object, using a shared implementation in Is_Effectively_Volatile_Object_Shared.
2020-10-16[Ada] GNAT-LLVM unnesting issues in elaboration codeGary Dismukes1-0/+198
gcc/ada/ * exp_ch7.adb (Check_Unnesting_In_Decls_Or_Stmts): In the case of an if-statement, call Unnest_If_Statement to determine whether there are nested subprograms in any of the statement lists of the "if" parts that require a wrapping procedure to handle possible up-level refeferences. (Unnest_Block): Call Check_Unnesting_In_Handlers to do unnesting of subprograms in exception handlers of the block statement. (Unnest_If_Statement): New procedure to traverse the parts of an if-statement and create wrapper procedures as needed to encapsulate nested subprograms that may make up-level references. (Check_Stmts_For_Subp_Unnesting): New support procedure in Unnest_If_Statement to traverse a statement list looking for top-level subprogram bodies that require wrapping inside a procedure (via Unnest_Statement_List) as well as possibly having other statements (block, loop, if) that may themselves require an unnesting transformation (via Check_Unnesting_In_Decls_Or_Stmts). (Unnest_Statement_List): New support procedure to traverse the statements of a statement list that contains subprogram bodies at the top level and replace the statement list with a wrapper procedure body encapsulating the statements and a call to the procedure.
2020-10-16[Ada] Crash when specifying an abstract subprogram with Stream_ConvertArnaud Charlet1-0/+3
gcc/ada/ * sem_prag.adb (Check_OK_Stream_Convert_Function): Check for abstract subprograms.
2020-10-16[Ada] Fix documentation of No_Local_Timing_EventsPiotr Trojanek2-2/+2
gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst (No_Local_Timing_Events): Package Timing_Events is a child of Ada.Real_Time, not of Ada. * gnat_rm.texi: Regenerate.
2020-10-16[Ada] Add Max_Integer_Size attribute and couple of helper functionsEric Botcazou16-674/+682
gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Document the new Max_Integer_Size attribute. * gnat_rm.texi: Regenerate. * exp_attr.adb (Get_Integer_Type): Call Small_Integer_Type_For. (Expand_N_Attribute_Reference) <Attribute_Pred>: Replace selection code with call to Integer_Type_For. <Attribute_Succ>: Likewise. <Attribute_Val>: Likewise. <Attribute_Valid>: Likewise. <Attribute_Max_Integer_Size>: Raise Program_Error. * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Replace selection code with call to Integer_Type_For. (Simple_Init_Initialize_Scalars_Type): Use Long_Long_Unsigned and System_Max_Integer_Size to size the largest integer type. * exp_pakd.adb (Compute_Linear_Subscript): Minor tweak. (Create_Packed_Array_Impl_Type): Use Small_Integer_Type_For. * exp_util.ads (Integer_Type_For): New function. (Small_Integer_Type_For): Likewise. * exp_util.adb (Adjust_Condition): Use Integer_Type_For. (Component_May_Be_Bit_Aligned): Use System_Max_Integer_Size. (Integer_Type_For): New function. (Small_Integer_Type_For): Likewise. (Matching_Standard_Type): Use Small_Integer_Type_For. (Needs_Constant_Address): Replace 64 with System_Max_Integer_Size. * freeze.adb (Set_Small_Size): Likewise. (Size_Known): Likewise. (Check_Suspicious_Modulus): Likewise. (Check_Large_Modular_Array): Likewise. (Freeze_Entity): Likewise. * layout.adb (Layout_Type): Likewise. * sem_aggr.adb: Add with and use clauses for Ttypes. (Resolve_Aggregate): Replace 64 with System_Max_Integer_Size. * sem_attr.ads (Attribute_Impl_Def): Add Attribute_Max_Integer_Size. * sem_attr.adb (Analyze_Attribute) <Attribute_Max_Integer_Size>: New (Eval_Attribute): Likewise. * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Change max scalar size to System_Max_Integer_Size. (Check_Array_Type): Replace 64 with System_Max_Integer_Size and remove superfluous test. (OK_Component): Likewise. * sem_ch5.adb: Add with and use clauses for Ttypes. (Analyze_Assignment): Replace 64 with System_Max_Integer_Size. * snames.ads-tmpl (Name_Max_Integer_Size): New attribute name. (Attribute_Id): Add Attribute_Max_Integer_Size. * ttypes.ads (System_Max_Integer_Size): New constant.
2020-10-16Daily bump.GCC Administrator1-0/+237
2020-10-15[Ada] Spurious visibility on private with packageArnaud Charlet3-8/+11
gcc/ada/ * sem_ch10.adb (Install_With_Clause): Fix implementation of Ada 2005 AI-262 by taking into account generic packages. Minor reformatting. * libgnat/a-cbhase.ads, libgnat/a-cbhase.adb: Remove use clause on runtime unit spec.
2020-10-15[Ada] Wrong use of Scope_Depth_ValueArnaud Charlet3-20/+32
gcc/ada/ * einfo.ads, einfo.adb (Scope_Depth_Value, Set_Scope_Depth_Value): Add assertions on valid nodes and update documentation accordingly. (Write_Field22_Name): Sync with change in Scope_Depth_Value. * sem_ch8.adb (Find_Direct_Name): Fix call to Scope_Depth_Value.
2020-10-15[Ada] Ada2020: AI12-0003 Specifying the standard storage poolJavier Miranda2-3/+20
gcc/ada/ * sem_prag.adb (Analyze_Pragma): Adding semantic support of Standard to Default_Storage_Pool. * freeze.adb (Freeze_Entity): If pragma Default_Storage_Pool applies and it is set to Standard then use the global pool as the associated storage pool of the access type.
2020-10-15[Ada] Cleanup definition of Might_Have_TasksJavier Miranda3-11/+10
gcc/ada/ * exp_ch6.ads (Might_Have_Tasks): Update documentation. * exp_ch6.adb (Might_Have_Tasks): Return also true when the type has tasks. (Make_Build_In_Place_Call_In_Allocator): Code cleanup. * exp_ch3.adb (Ensure_Activation_Chain_And_Master, Expand_N_Full_Type_Declaration, Expand_N_Object_Declaration): Code cleanup.
2020-10-15[Ada] Get finalization right when a function returns a function callSteve Baird6-20/+40
gcc/ada/ * checks.adb (Apply_Predicate_Check): Generate "infinite recursion" warning message even if run-time predicate checking is disabled. * exp_ch6.adb (Expand_Simple_Function_Return): In testing whether the returned expression is a function call, look for the case where the call has been transformed into a dereference of an access value that designates the result of a function call. * sem_ch3.adb (Analyze_Object_Declaration): Legality checking for a static expression is unaffected by assertion policy (and, in particular, enabling/disabling of subtype predicates. To get the right legality checking, we need to call Check_Expression_Against_Static_Predicate for a static expression even if predicate checking is disabled for the given predicate-bearing subtype. On the other hand, we don't want to call Make_Predicate_Check unless predicate checking is enabled. * sem_ch7.adb (Uninstall_Declarations.Preserve_Full_Attributes): Preserve the Predicates_Ignored attribute. * sem_eval.adb (Check_Expression_Against_Static_Predicate): Previously callers ensured that this procedure was only called if predicate checking was enabled; that is no longer the case, so predicates-disabled case must be handled. * sem_prag.adb (Analyze_Pragma): Fix bug in setting Predicates_Ignored attribute in Predicate pragma case.
2020-10-15[Ada] Crash on subtype of fixed-point typeEd Schonberg1-11/+10
gcc/ada/ * freeze.adb (Freeze_Fixed_Point_Type): Do not scale the bounds of a declared subtype using the 'Small of the type; this is done during resolution of the bound itself, unlike what is done for the bounds of the base type, which are used to determine its required size. Previous code performed this scaling twice, leading to meaningless values for such a subtype.