aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2025-01-02Rotate ChangeLog files.Jakub Jelinek16-8321/+8302
Rotate ChangeLog files for ChangeLogs with yearly cadence. Also remove empty lines before Form Feed line.
2024-12-23Daily bump.GCC Administrator1-0/+12
2024-12-22Ada: Fix GNU/Hurd maximum prioritySamuel Thibault1-1/+1
gcc/ada/ChangeLog: * libgnat/system-gnu.ads: Set Max_Priority to 60. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2024-12-22Ada: Add GNU/Hurd glibc api bitsSamuel Thibault1-7/+7
They are mostly shared with Linux gcc/ada/ChangeLog: * s-oscons-tmplt.c [__GNU__] (_XOPEN_SOURCE, _BSD_SOURCE): Define. [__GNU__]: Include <pthread.h> and <signal.h> [__GNU__]: Set MSG_Forced_Flags to "MSG_NOSIGNAL". [__GNU__]: Define SIZEOF_sigset. [__GNU__]: Define PTHREAD_*SIZE Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2024-12-19Daily bump.GCC Administrator1-0/+6
2024-12-18Output the load address in backtraces for PIE executables on DarwinSimon Wright1-1/+19
This aligns Darwin with Linux and Windows. gcc/ada/ PR target/117538 * libgnat/s-trasym.adb (Symbolic_Traceback): Prepend the load address of the executable if it is not null.
2024-12-15Daily bump.GCC Administrator1-0/+6
2024-12-14opts: Use OPTION_SET_P instead of magic value 2 for -fshort-enums default ↵Jakub Jelinek1-1/+1
[PR118011] The magic values for default (usually -1 or sometimes 2) for some options are from times we haven't global_options_set, I think we should eventually get rid of all of those. The PR is about gcc -Q --help=optimizers reporting -fshort-enums as [enabled] when it is disabled. For this the following patch is just partial fix; with explicit gcc -Q --help=optimizers -fshort-enums or gcc -Q --help=optimizers -fno-short-enums it already worked correctly before, with this patch it will report even with just gcc -Q --help=optimizers correct value on most targets, except 32-bit arm with some options or defaults, so I think it is a step in the right direction. But, as I wrote in the PR, process_options isn't done before --help= and even shouldn't be in its current form where it warns on some option combinations or errors or emits sorry on others, so I think ideally process_options should have some bool argument whether it is done for --help= purposes or not, if yes, not emit warnings and just adjust the options, otherwise do what it currently does. 2024-12-14 Jakub Jelinek <jakub@redhat.com> PR c/118011 gcc/ * opts.cc (init_options_struct): Don't set opts->x_flag_short_enums to 2. * toplev.cc (process_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2. gcc/ada/ * gcc-interface/misc.cc (gnat_post_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2.
2024-12-14Daily bump.GCC Administrator1-0/+208
2024-12-13ada: Fix internal error on packed record with 0-size componentEric Botcazou1-1/+17
The problem is that the order of components listed in a constant CONSTRUCTOR does not match that of the associated record type. gcc/ada/ChangeLog: * gcc-interface/utils2.cc (compare_elmt_bitpos): Deal specially with 0-sized components when the bit position is the same.
2024-12-13ada: Pass artificial_p to create_type_declTom Tromey1-2/+2
The recent "nameless types" change to gcc-interface caused the gdb pretty-printer for VSS to fail. This happens because one call to create_type_decl unconditionally passes "true" as the "artificial_p" parameter. This patch changes this call to instead pass the entity's local artificial_p value instead. This makes sense, I think, because the type decl being created for debug purposes (as the comment says) is there to represent the relevant entity from the source. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Pass artificial_p to create_type_decl.
2024-12-13ada: Cleanup preanalysis of static expressionsJavier Miranda16-164/+144
During preanalysis, the frontend does not generate freeze nodes. The exception to this rule occurs during the preanalysis of default and per-object expressions, where static expressions are frozen. A patch merged six years ago to address an issue in this area introduced additional complexity and confusion regarding the frontend's behavior in such cases. The purpose of this patch is to revert that change, simplifying the support for the preanalysis of static expressions to make it cleaner and easier to understand. gcc/ada/ChangeLog: * sem.ads (Inside_Preanalysis_Without_Freezing): Removed. * sem.adb (Semantics): Remove Inside_Preanalysis_Without_Freezing. * sem_ch6.adb (Preanalyze_Formal_Expression): Removed. * sem_ch3.ads (Preanalyze_Assert_Expression): Add documentation. (Preanalyze_Spec_Expression): Add documentation. * sem_ch3.adb (Preanalyze_Assert_Expression) Code cleanup. (Preanalyze_Default_Expression): Code cleanup. * sem_res.ads (Preanalyze_With_Freezing_And_Resolve): Removed. * sem_res.adb (Preanalyze_With_Freezing_And_Resolve): Removed. (Preanalyze_And_Resolve): Code cleanup. * freeze.adb (Freeze_Entity): No freeze under strict preanalysis. (Freeze_Expression): Code cleanup. (Freeze_Expr_Types): Replace call to Preanalyze_Spec_Expression by strict preanalysis during preanalysis of a duplicate of the expression performed to have available the minimum decoration to locate referenced unfrozen types. * sem_aggr.adb (Resolve_Array_Aggregate): Minor code cleanup. * sem_attr.adb (Resolve_Attribute): Add documentation. * sem_ch13.adb (Resolve_Aspect_Expressions[Aspect_Default_Value]): Replace call to Preanalyze_Spec_Expression by Preanalyze_And_Resolve. (Resolve_Aspect_Expressions[Aspect_Default_Component_Value]): Ditto. * sem_ch8.adb (Set_Entity_Or_Discriminal): Code cleaup. * sem_prag.adb (Analyze_Initial_Condition_In_Decl_Part): Replace call to Preanalyze_Assert_Expression by call to Preanalyze_And_Resolve. (Analyze_Pre_Post_Condition): Replace call to Preanayze_Spec_Expression by call to Preanalyze_Assert_Expression. * sem_util.ads (In_Pragma_Expression): Adding a formal to extend the functionality of this subprogram. (Within_Static_Expression): New subprogram. * sem_util.adb (In_Pragma_Expression): Ditto. (Within_Static_Expression): Ditto. * checks.adb (Install_Null_Excluding_Check): No check during preanalysis. (Install_Primitive_Elaboration_Check): Ditto.
2024-12-13ada: Improve expansion of nested conditional expressions in return statementsEric Botcazou8-91/+332
This arranges for nested conditional expressions in simple return statements to have their expansion delayed until the returns are distributed into their dependent expressions. This comprises the case of the elsif part of an if expression present in the source code. This also distributes qualified expressions into the dependent expressions of conditional expressions, although this seems to occur rarely in practice. gcc/ada/ChangeLog: * exp_aggr.ads (Is_Delayed_Conditional_Expression): Move to... * exp_aggr.adb (Is_Delayed_Conditional_Expression): Move to... (Convert_To_Assignments): Use Delay_Conditional_Expressions_Between. * exp_ch3.adb (Expand_N_Object_Declaration): Reset the Analyzed flag by means of Unanalyze_Delayed_Conditional_Expression. * exp_ch4.adb (Expand_N_Case_Expression): Likewise. Delay expanding the expression if it is in the context of a simple return statement. (Expand_N_If_Expression): Likewise. (Expand_N_Qualified_Expression): Fold identical operand. Distribute the expression into an operand that is a conditional expression with expansion delayed. (Process_Transient_In_Expression): Also test the parent node for the presence of a simple return statement. * exp_ch6.adb (Expand_Ctrl_Function_Call): Test the unconditional parent node for the presence of a simple return statement. * exp_util.ads (Delayed Expansion): New description. (Delay_Conditional_Expressions_Between): New procedure. (Is_Delayed_Conditional_Expression): ...here. (Unanalyze_Delayed_Conditional_Expression): New procedure. (Unconditional_Parent): New function. * exp_util.adb (Find_Hook_Context): Take into account conditional statements coming from conditional expressions. (Within_Conditional_Expression): Likewise. (Delay_Conditional_Expressions_Between): New procedure. (Is_Delayed_Conditional_Expression): ...here. (Unanalyze_Delayed_Conditional_Expression): New procedure. (Unconditional_Parent): New function. * sinfo.ads (Expansion_Delayed): Adjust description.
2024-12-13ada: Fix indentation in record component declarationsPiotr Trojanek4-8/+8
Code cleanup. gcc/ada/ChangeLog: * exp_aggr.adb (Case_Bounds): Fix indentation. * sem_case.adb (Choice_Bounds): Likewise. * libgnat/s-dourea.ads (Duuble_T): Likewise. * libgnat/s-excmac__arm.ads (Cleanup_Cache_Type): Likewise.
2024-12-13ada: Fix code indentationPiotr Trojanek34-253/+254
Fix uncontroversial coding style violations detected by an experiment with a tree-sitter indentation support in Emacs. gcc/ada/ChangeLog: * atree.adb, diagnostics-pretty_emitter.adb, diagnostics-utils.adb, einfo-utils.adb, errout.adb, exp_aggr.adb, exp_ch3.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_imgv.adb, exp_pakd.adb, exp_prag.adb, exp_unst.adb, exp_util.adb, gnatchop.adb, gnatlink.adb, inline.adb, itypes.adb, osint.adb, rtsfind.adb, sem_aggr.adb, sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_dim.adb, sem_elab.adb, sem_prag.adb, sem_util.adb, sprint.adb, switch-m.adb, table.adb: Fix code indentation.
2024-12-13ada: Fix fixed point text-io when subtype has dynamic rangeMarc Poulhiès6-150/+210
When the fixed point subtype has dynamic range, for example in the context of a generic procedure Test where Fixed_Type is a type formal: procedure Test (Low, High : Fixed_Type) is type New_Subtype is new Fixed_Type range Low .. High; package New_Io is new Text_IO.Fixed_IO (New_Subtype); the compiler would complain with: non-static universal integer value out of range Have the check use the Base type for checking what integer type can be used. If a given integer type can be used for a base type, it can also be used for any of its subtypes. gcc/ada/ChangeLog: * libgnat/a-tifiio.adb (OK_Get_32): Use 'Base. (OK_Put_32, OK_Get_64, OK_Put_64): Likewise. * libgnat/a-tifiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64) (OK_Put_64, OK_Get_128, OK_Put_128): Likewise. * libgnat/a-wtfiio.adb (OK_Get_32): Likewise. (OK_Put_32, OK_Get_64, OK_Put_64): Likewise. * libgnat/a-wtfiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64) (OK_Put_64, OK_Get_128, OK_Put_128): Likewise. * libgnat/a-ztfiio.adb (OK_Get_32): Likewise. (OK_Put_32, OK_Get_64, OK_Put_64): Likewise. * libgnat/a-ztfiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64) (OK_Put_64, OK_Get_128, OK_Put_128): Likewise.
2024-12-13ada: Refactor code of Check_Ambiguous_Call and Valid_ConversionJavier Miranda1-17/+7
gcc/ada/ChangeLog: * sem_res.adb (Report_Ambiguous_Argument): Code cleanup. (Resolve): Code cleanup.
2024-12-13ada: Implement new rules about effectively volatile types in SPARKPiotr Trojanek2-0/+53
New rules make record types effectively volatile based on the effective volatility of their components; same for effectively volatile for reading. Now volatility composition for records works like volatility composition for arrays. gcc/ada/ChangeLog: * sem_util.adb (Is_Effectively_Volatile, Is_Effectively_Volatile_For_Reading): Implement new rule for record types. * sem_util.ads (Is_Effectively_Volatile, Is_Effectively_Volatile_For_Reading): Adjust comments.
2024-12-13ada: Remove unused parameter from volatile type queriesPiotr Trojanek2-38/+12
Routines Is_Effectively_Volatile and Is_Effectively_Volatile_For_Reading were always called with Ignore_Protected parameter set to True (or has been passed unmodified on recursive calls), so this parameter wasn't actually needed. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_util.adb (Is_Effectively_Volatile, Is_Effectively_Volatile_For_Reading): Remove Ignore_Protected parameter. (Is_Effectively_Volatile_Object, Is_Effectively_Volatile_Object_For_Reading): Remove single-parameter wrappers that are needed to instantiate generic subprogram. * sem_util.ads (Is_Effectively_Volatile, Is_Effectively_Volatile_For_Reading): Remove parameter; adjust comment.
2024-12-13ada: Elide copy for calls in allocators for nonlimited by-reference typesEric Botcazou3-36/+36
This prevents a temporary from being created on the primary stack to hold the result of the function calls before it is copied to the newly allocated memory in the nonlimited by-reference case. That's already not done in the nonlimited non-by-reference case and there is no reason to do it in the former case either. The main issue is the call to Remove_Side_Effects in Expand_Allocator_Expression, but its only purpose is to cover the problematic processing done in Build_Allocate_Deallocate_Proc on (part of) the expression; once this is fixed, the call is unnecessary. The change also contains another small fix to deal with the corner case of allocators for access-to-access types. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_Allocator_Expression): Do not preventively call Remove_Side_Effects on the expression in the nonlimited by-reference case. Always call Build_Allocate_Deallocate_Proc in the default case. * exp_ch6.adb (Expand_Ctrl_Function_Call): Bail out if the call is the qualified expression of an allocator. * exp_util.adb (Build_Allocate_Deallocate_Proc): Replace all the calls to Relocate_Node by calls to Duplicate_Subexpr_No_Checks.
2024-12-13ada: Remove last call to Preanalyze_And_Resolve from Exp_AggrEric Botcazou1-4/+1
All the expressions are now at least preanalyzed in a non-iterated context, so we do not need to redo it in Aggr_Assignment_OK_For_Backend, given that Is_OK_Aggregate explicitly rejects iterated component associations. gcc/ada/ChangeLog: * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Do not call again Preanalyze_And_Resolve on the expression.
2024-12-13ada: Fix breakage of GNATprove introduced by latest changeEric Botcazou1-2/+3
gcc/ada/ChangeLog: * sem_aggr.adb (Resolve_Aggr_Expr): Always perform a full analysis of the expression in SPARK mode.
2024-12-13ada: Fix typo in reference manualRonan Desplanques3-3/+3
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Fix typo. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-12-13ada: Fix dangling reference with user-defined indexing of function callEric Botcazou1-0/+36
This happens with a noncontrolled type because the user-defined indexing is expanded into a function call that binds the lifetime of the original call to its return value. The temporary must be created explicitly in this case, so that the front-end can control its lifetime. gcc/ada/ChangeLog: * exp_ch6.adb (Expand_Call_Helper): Also create a temporary in the case of a noncontrolled user-defined indexing.
2024-12-13ada: Fix documentation of Ada.Real_Time.Timing_EventsRonan Desplanques3-3/+5
The GNAT reference manual stated that GNAT did not implement this language-defined package, but GNAT in fact does offer an implementation of it. gcc/ada/ChangeLog: * doc/gnat_rm/standard_library_routines.rst: Fix documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-12-13ada: Exclude library units from gnatcov instrumentationRonan Desplanques1-1/+18
Before this patch, we instrumented code that's only used during the build process to generate more code. This patch marks the code-generating code so it's not instrumented for coverage. gcc/ada/ChangeLog: * gnat2.gpr: Add library units to coverage exclusion list.
2024-12-13ada: Further work in semantic analysis of iterated component associationsEric Botcazou2-126/+86
This finishes up the transition to preanalysis of a copy of the expression for iterated component associations in all contexts, thus voiding the need to clean things up afterward. However, this requires a larger cleanup in semantics analysis of aggregates, in particular for others choices, which are currently skipped in Sem_Aggr, with Exp_Aggr trying to patch things up afterward but leaving some legality loopholes in the end. That's why this makes sure that all the expressions appearing in aggregates are either analyzed or preanalyzed by Sem_Aggr, as documented in the spec of Sem, modulo the copy in an iteration context. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Array_Aggr_Code): Remove obsolete comment. (Convert_To_Positional): Remove Ctyp local variable. (Is_Static_Element): Remove Dims parameter and do not preanalyze the expression there. (Expand_Array_Aggregate): Make Ctyp a constant. (Compute_Others_Present): Do not preanalyze the expression there. * sem_aggr.adb (Resolve_Array_Aggregate): New Ctyp constant. Use it throughout the procedure to denote the component type. (Resolve_Aggr_Expr): Always preanalyze a copy of the expression in an iteration context. Preanalyze it directly when the expander is active and the choice may cover multiple components. Otherwise, fully analyze it. Do not reanalyze an iterated component association with an others choice either when there are positional components. (Resolve_Iterated_Component_Association): Do not remove references from the expression after invoking Resolve_Aggr_Expr on it.
2024-12-13ada: Remove implicit assumption in the double caseEric Botcazou1-7/+16
The assumption is fulfilled in all the instantiations of the package, but it should not be made in the generic code. gcc/ada/ChangeLog: * libgnat/s-imager.adb (Set_Image_Real): In the case where a double integer is needed, do not implicit assume that it can contain up to 'Digits of the floating-point type.
2024-12-13ada: Adjust cut-off for scaling of floating-point numbersEric Botcazou1-8/+7
The value needs to take into account denormals and encompass Maxdigs. gcc/ada/ChangeLog: * libgnat/s-imager.adb (Maxscaling): Change to Natural constant and add Maxdigs to value.
2024-12-13Daily bump.GCC Administrator1-0/+219
2024-12-12Fix precondition failure with Ada.Numerics.Generic_Real_Arrays.EigenvaluesEric Botcazou1-10/+14
This fixes a precondition failure triggered when the Eigenvalues routine of Ada.Numerics.Generic_Real_Arrays is instantiated with -gnata, beause it calls Sort_Eigensystem on an empty vector. gcc/ada PR ada/117996 * libgnat/a-ngrear.adb (Jacobi): Remove default value for Compute_Vectors formal parameter. (Sort_Eigensystem): Add Compute_Vectors formal parameter. Do not modify the Vectors if Compute_Vectors is False. (Eigensystem): Pass True as Compute_Vectors to Sort_Eigensystem. (Eigenvalues): Pass False as Compute_Vectors to Sort_Eigensystem. gcc/testsuite * gnat.dg/matrix1.adb: New test.
2024-12-12ada: Fix reference to Ada 2020 in commentPiotr Trojanek1-1/+1
Code cleanup. gcc/ada/ChangeLog: * par-ch5.adb (Test_Statement_Required): Fix comment.
2024-12-12ada: Elide the copy for bit-packed aggregates in object declarationsEric Botcazou2-9/+35
The in-place expansion has been historically disabled for them, but there does not seem to be any good reason left for this. However, this requires a small trick in order for the expanded code not to be flagged as using the object uninitialized by the code generator. gcc/ada/ChangeLog: * exp_aggr.adb (Convert_Aggr_In_Object_Decl): Clear the component referenced on the right-hand side of the first assignment generated for a bit-packed array, if any. (Expand_Array_Aggregate): Do not exclude aggregates of bit-packed array types in object declarations from in-place expansion. * sem_eval.adb (Eval_Indexed_Component): Do not attempt a constant evaluation for a bit-packed array type.
2024-12-12ada: Defend against risk of infinite loopRonan Desplanques1-1/+3
A recently fixed bug caused an infinite loop when assertions were not checked. With assertions checked, the symptom was just an internal error caused by an assertion failure. This patch makes it so that if another bug ever causes the same condition to fail, there will never be an infinite loop with any assertion policy. gcc/ada/ChangeLog: * sem_ch3.adb (Access_Subprogram_Declaration): Replace assertion with more defensive code.
2024-12-12ada: Avoid going through symlinks in the json reportViljar Indus1-1/+2
gcc/ada/ChangeLog: * errout.adb (Write_JSON_Location): Avoid going through symbolic links when printing the full name.
2024-12-12ada: Fix minor display issue on invalid floatsRonan Desplanques1-1/+4
GNAT implements a format with trailing '*' signs for the Image attribute of NaN, +inf and -inf. It was probably always intended to be the same length as the image of 1.0, but one '*' was actually missing. This patch fixes this. gcc/ada/ChangeLog: * libgnat/s-imager.adb (Image_Floating_Point): Tweak display of invalid floating point values.
2024-12-12ada: Improve task entry context detectionRonan Desplanques2-7/+10
Access parameters are not allowed in specifications of task entries. Before this patch, the compiler failed to detect that case in accept statements that were not directly in their task body's scopes. This patch fixes this issue. gcc/ada/ChangeLog: * sem_ch3.adb (Access_Definition): Remove test for task entry context. * sem_ch6.adb (Process_Formals): Add improved test for task entry context.
2024-12-12ada: Refactor warning about null loopsPiotr Trojanek1-8/+9
Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Move call to Comes_From_Source to the outer if-statement.
2024-12-12ada: Fix internal error on loop parameter specificationsPiotr Trojanek1-7/+13
Originally loop parameter specification only occurred in loops, but now it also occurs in quantified expressions. This patch guards against flagging non-loop nodes as null loop statements. This was causing internal compiler errors that were only visible with switch -gnatdk, which happens to be default in GNATprove testsuite. gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Only set flag Is_Null_Loop when loop parameter specification comes from a loop and not from a quantified expression.
2024-12-12ada: Elide the copy for bit-packed aggregates in allocatorsEric Botcazou1-7/+4
The in-place expansion has been historically disabled for them, but there does not seem to be any good reason left for this. gcc/ada/ChangeLog: * exp_aggr.adb (Expand_Array_Aggregate): Do not exclude aggregates of bit-packed array types in allocators from in-place expansion.
2024-12-12ada: Fix the level of the LLVM chapter in the User's GuideSebastian Poeplau2-7/+7
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move the LLVM chapter one level up. * gnat_ugn.texi: Regenerate.
2024-12-12ada: Accept static strings with External_InitializationRonan Desplanques5-70/+91
Before this patch, the argument to the External_Initialization aspect had to be a string literal. This patch extends the possibilities so that any static string is accepted. A new helper function, Is_OK_Static_Expression_Of_Type, is introduced, and in addition to the main change of this patch a couple of calls to that helper function are added in other places to replace equivalent inline code. gcc/ada/ChangeLog: * sem_eval.ads (Is_OK_Static_Expression_Of_Type): New function. * sem_eval.adb (Is_OK_Static_Expression_Of_Type): Likewise. * sem_ch13.adb (Check_Expr_Is_OK_Static_Expression): Use new function. * sem_prag.adb (Check_Expr_Is_OK_Static_Expression): Likewise. * sem_ch3.adb (Apply_External_Initialization): Accept static strings for the parameter.
2024-12-12ada: Fix reference manual clausesRonan Desplanques10-15/+17
The clauses in section 3.5 of the reference manual were moved around along the different Ada versions, which caused some comments in our source code to go out of date. This patch updates the references in those comments. gcc/ada/ChangeLog: * libgnat/a-tifiio.adb: Fix comment. * libgnat/a-tifiio__128.adb: Likewise. * libgnat/s-imaged.ads (Image_Decimal): Likewise. * libgnat/s-imagef.ads (Image_Fixed): Likewise. * libgnat/s-imager.ads (Image_Fixed_Point): Likewise. * libgnat/s-imde32.ads (Image_Decimal32): Likewise. * libgnat/s-imfi64.ads (Image_Fixed64): Likewise. * libgnat/s-imgcha.adb (Image_Character): Likewise. * libgnat/s-valuer.adb (Scan_Raw_Real): Likewise. * sem_attr.adb (Eval_Attribute): Likewise.
2024-12-12ada: Fix pragma Compile_Time_Error for sizes of nonstatic array typesEric Botcazou1-1/+8
The pragma is consistenly rejected for the sizes of nonstatic array types because Eval_Attribute does not evaluate it even if it is known. gcc/ada/ChangeLog: * sem_attr.adb (Eval_Attribute): Treat the various size attributes like Component_Size for nonstatic array types.
2024-12-12ada: Refactor code of Check_Ambiguous_Call and Valid_ConversionJavier Miranda1-2/+1
gcc/ada/ChangeLog: * sem_res.adb (Is_Ambiguous_Operand): Add missing decoration of the operand when it is labeled overloaded but has just one interpretation.
2024-12-12ada: Minor refactoring in expansion of array aggregatesEric Botcazou1-44/+60
This just moves a couple of checks done in conjunction with the predicate Aggr_Assignment_OK_For_Backend into its body and adds a couple of comments. No functional changes. gcc/ada/ChangeLog: * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Add Target formal parameter and check that it is not a bit-aligned component or slice. Return False in CodePeer mode as well. (Build_Array_Aggr_Code): Remove redundant tests done in conjunction with a call to Aggr_Assignment_OK_For_Backend. (Expand_Array_Aggregate): Likewise. Add a couple of comments and improve formatting.
2024-12-12ada: Fix validity check for private typesRonan Desplanques1-2/+2
Before this patch, the machinery to generate validity checks got confused in some situations involving private views of types, and ended up generating incorrect conversions from floating point types to integer types. This patch fixes this. gcc/ada/ChangeLog: * exp_attr.adb (Expand_N_Attribute_Reference): Fix computation of type category.
2024-12-12ada: Add minimal support for other delayed aspects on controlled objectsEric Botcazou5-82/+58
This extends the processing done for the Address aspect to other delayed aspects. The External_Name aspect is also reclassified as a representation aspect and the three representation aspects External_Name, Link_Name and Linker_Section are moved from the Always_Delay to the Rep_Aspect category, which makes it possible not to delay them in most cases with a small tweak. gcc/ada/ChangeLog: * aspects.ads (Is_Representation_Aspect): True for External_Name. (Aspect_Delay): Use Rep_Aspect for External_Name, Link_Name and Linker_Section. * einfo.ads (Initialization_Statements): Document extended usage. * exp_util.adb (Needs_Initialization_Statements): Return True for all delayed aspects. * freeze.adb (Check_Address_Clause): Do not move the initialization expression here... (Freeze_Object_Declaration): ...but here instead, as well as for all delayed aspects. Remove test for pragma Linker_Section. * sem_ch13.adb (Analyze_One_Aspect): Do not delay in the Rep_Aspect case if the expression is a string literal.
2024-12-12ada: Fix documentation comment for Scan_SignRonan Desplanques1-7/+6
This patches fixes a couple of details that were wrong in the documentation comment for System.Val_Util.Scan_Sign. gcc/ada/ChangeLog: * libgnat/s-valuti.ads (Scan_Sign): Fix documentation comment.
2024-12-12ada: Crash on assignment of task allocator with expanded nameBob Duff1-13/+18
The compiler crashes on an assignment statement of the form "X.Y := new T;", where X.Y is an expanded name (i.e. not a record component or similar) and T is a type containing tasks. gcc/ada/ChangeLog: * exp_util.adb (Build_Task_Image_Decls): Deal properly with the case of an expanded name. Minor cleanup: use a case statement instead of if/elsif chain.