[COMMITTED] ada: Fix documentation of -gnatwc

2023-11-07 Thread Marc Poulhiès
From: Ronan Desplanques -gnatwc has been correctly emitting warnings for expressions outside of tests for a while, but its documentation in the user's guide had never been updated to reflect that. Also, the documentation used "conditional expressions" to designate boolean expressions, but "condit

[COMMITTED] ada: Remove duplicated code for expansion of packed array assignments

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Expansion of assignments to packed array objects has two cases and had duplicated code for both these cases. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove code from the ELSE branch, because it was is identical to code before the IF

[COMMITTED] ada: Cleanup "not Present" on List_Id

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek gcc/ada/ * exp_ch6.adb, exp_disp.adb, sem_ch13.adb, sem_ch3.adb: Fix newly detected violations. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 2 +- gcc/ada/exp_disp.adb | 2 +- gcc/ada/sem_ch13.adb | 2 +- gcc/ada/sem_ch3.a

[COMMITTED] ada: Compiler crash on early alignment clause

2023-11-07 Thread Marc Poulhiès
From: Bob Duff This patch fixes a bug: if "for T'Alignment use..." is followed by "for T use ();" the compiler crashes. A workaround is to move the alignment clause after the enumeration rep clause. gcc/ada/ * sem_ch13.ads (Set_Enum_Esize): Do not set alignment. * sem_ch13.adb (

[COMMITTED] ada: Cleanup more "not Present"

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek We had a GNATcheck rule that suggests replacing "not Present (...)" with "No (...)", but it only detected calls with a parameter of type Node_Id. Now this rules also detects parameters of type Elist_Id. gcc/ada/ * sem_ch3.adb, sem_ch4.adb, sem_eval.adb: Fix newly de

[COMMITTED] ada: Elide temporary for aliased array with unconstrained nominal subtype

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou When the array is initialized with the result of a call to a function whose result type is unconstrained, then the result is allocated with its bounds, so the array can be rewritten as a renaming of the result in this case too. gcc/ada/ * exp_ch3.adb (Expand_N_Object

[COMMITTED] ada: Fix Ada.Directories.Modification_Time on Windows

2023-11-07 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, Ada.Directories.Modification_Time called GetFileAttributesExA under the hood on Windows. That would sometimes fail to work with files whose names were non-ASCII. This patch replaces the call to GetFileAttributesExA with a call to GetFileAttributesEx pre

[COMMITTED] ada: Minor tweaks for comparison operators

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou No functional changes. gcc/ada/ * gen_il-gen-gen_nodes.adb (N_Op_Boolean): Fix description. * sem_ch4.adb (Analyze_Comparison_Equality_Op): Tidy up. * sem_ch12.adb (Copy_Generic_Node): Use N_Op_Compare subtype. Tested on x86_64-pc-linux-gnu, committe

[COMMITTED] ada: Implement Aspects as fields under nodes

2023-11-07 Thread Marc Poulhiès
From: Viljar Indus In the previous implementation Aspect Specifications were stored in a separate table and not directly under each node. This implementation included a lot of extra code that needed to be maintained manually. The new implementation stores Aspect_Specfications as a syntactic fiel

[COMMITTED] ada: Rename Is_Limited_View to reflect actual query

2023-11-07 Thread Marc Poulhiès
From: Yannick Moy Function Sem_Aux.Is_Limited_View returns whether the type is "inherently limited" in a slightly different way from the "immutably limited" definition in Ada 2012. Rename for clarity. gcc/ada/ * exp_aggr.adb: Apply the renaming. * exp_ch3.adb: Same. * ex

[COMMITTED] ada: Update the logo in the gnat doc

2023-11-07 Thread Marc Poulhiès
From: Julien Bortolussi Update the logo and the background color in the top right corner of the GNAT User’s Guide for Native Platforms gcc/ada/ * doc/share/conf.py: Changed the background color and the logo. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/share/co

[COMMITTED] ada: Fix spurious -Wstringop-overflow with link time optimization

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou It comes from an incomplete optimization performed by LTO that is caused by an obsolete transformation done in Gigi, which is redundant with the common uniquization of constant CONSTRUCTORs now performed during gimplification. gcc/ada/ * gcc-interface/trans.cc (gnat_

Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting)

2023-11-09 Thread Marc Poulhiès
Arnaud Charlet writes: > Marc, can you please take care of it when you get a chance? I'll push the change as soon as the tests are finished. Marc

Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting)

2023-11-09 Thread Marc Poulhiès
Marc Poulhiès writes: > Arnaud Charlet writes: > >> Marc, can you please take care of it when you get a chance? > > I'll push the change as soon as the tests are finished. Pushed as r14-5282. Marc

Re: [PATCH][Ada] Fix syntax errors in expect.c

2023-11-10 Thread Marc Poulhiès
Andris Pavēnis writes: > Fixing these errors (attached patch for master branch) was not sufficient for > building Ada cross-compiler, but it fixed compiler errors. > > This would perhaps qualify for trivial change, but it seems that I no more > have > write access (I got it in 2015, but have n

Re: [PATCH 2/3] Add generated .opt.urls files

2023-11-13 Thread Marc Poulhiès
David Malcolm writes: > gcc/ada/ChangeLog: > * gcc-interface/lang.opt.urls: New file, autogenerated by > regenerate-opt-urls.py. > diff --git a/gcc/ada/gcc-interface/lang.opt.urls > b/gcc/ada/gcc-interface/lang.opt.urls > new file mode 100644 > index ..e24210bcb12a >

Re: [PATCH 2/3] Add generated .opt.urls files

2023-11-13 Thread Marc Poulhiès
David Malcolm writes: > > The new regenerate-opt-urls.py script only parsed > buildir/gcc/HTML/gcc-14.0.0/gcc/Option-Index.html > looking for anchors for options via a regex. > > Looking at my build, I don't see any generated Ada HTML docs, so maybe > I messed this up? Does the generated HTML

Re: [PATCH v2 3/5] ada: Improve attribute exclusion handling

2023-11-17 Thread Marc Poulhiès
Hello, > I haven't manged to test the Ada frontend, but this patch (and the following I don't have an aarch64 setup to test, but I may be able to help with the issue preventing you from testing. Can you elaborate what is the problem? Marc

Re: [PATCH v2 3/5] ada: Improve attribute exclusion handling

2023-11-20 Thread Marc Poulhiès
Andrew Carlotti writes: > On Fri, Nov 17, 2023 at 11:45:16AM +0100, Marc Poulhi�s wrote: >> >> Hello, >> >> > I haven't manged to test the Ada frontend, but this patch (and the >> > following >> >> I don't have an aarch64 setup to test, but I may be able to help with the >> issue preventing

[COMMITTED] ada: Trivial typo fix in comment

2023-11-21 Thread Marc Poulhiès
gcc/ada/ * exp_util.ads: Typo fix. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 95ea4403c5d..932bf3fdcbc 100644 --- a/gcc/ada/exp_util.ad

[COMMITTED] ada: Fix SCOs generation for aspect specifications

2023-11-21 Thread Marc Poulhiès
From: Pierre-Marie de Rodat The recent overhaul for the representation of aspect specifications in the tree broke SCOs generation: decisions that appeared in aspects were processed twice, leading to the emission of erroneous obligations. Tweak SCOs generation to skip aspect specifications the sec

[COMMITTED] ada: Always use -gnatg in run-time GPR files

2023-11-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes it so -gnatg is always passed to the compiler when rebuilding the run-time library with the dedicated GPR files. Before this patch, if a user rebuilt the run-time with -XADAFLAGS=XXX where XXX didn't include "-gnatg", the build would immediately fail. This

[COMMITTED] ada: Deep delta aggregates

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Add support for "deep" delta aggregates, a GNAT-defined language extension conditionally enabled via the -gnatX0 switch. In a deep delta aggregate, a delta choice may specify a subcomponent (as opposed to just a component). gcc/ada/ * par.adb: Add new Boolean variable

[COMMITTED] ada: Fix misplaced index directive in documentation

2023-11-21 Thread Marc Poulhiès
The index directive must be located before the indexed element, at least for the generated texinfo to be correct. See: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-index This was reported along with changes done in https://inbox.sourceware.org/gcc-patches

[COMMITTED] ada: Runtime recompilation instructions improvements.

2023-11-21 Thread Marc Poulhiès
From: Doug Rupp Revise instructions to work on both cross and native targets hosted on Linux gcc/ada/ * libgnat/libada.gpr: Revise section 1 Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/libada.gpr | 13 +++-- 1 file changed, 7 insertions(+), 6 delet

[COMMITTED] ada: Small cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This removes an obsolete flag and adjusts a couple of obsolete comments. gcc/ada/ * gen_il-fields.ads (Opt_Field_Enum): Remove Is_Finalization_Wrapper * gen_il-gen-gen_nodes.adb (N_Block_Statement): Likewise. * sinfo.ads (Is_Finalization_Wrapper): Del

[COMMITTED] ada: Fix spurious error on call with default parameter in generic package

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This occurs when the default value is a function call returning a private type, and is caused by a bad interaction between two internal mechanisms. gcc/ada/ * sem_ch12.adb (Save_Global_References.Set_Global_Type): Beef up comment about the setting of the full

[COMMITTED] ada: Use CLOCK_MONOTONIC on VxWorks

2023-11-21 Thread Marc Poulhiès
From: Doug Rupp The monotonic clock keeps track of the time that has elapsed since system startup; that is, the value returned by clock_gettime() is the amount of time (in seconds and nanoseconds) that has passed since the system booted. The monotonic clock cannot be reset. As a result, time inte

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This removes the specific treatment of transient scopes in initialization procedures, which is obsolete. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): Do not treat initialization procedures specially when it comes to creating a transient scope. *

[COMMITTED] ada: Deep delta aggregates cleanup.

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Cleanup after the introduction of deep delta aggregates. Eliminate a new gnatcheck message. gcc/ada/ * sem_aggr.adb: Replace "not Present (...)" call with "No (...)" call. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 2 +- 1 file ch

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The bodies of generic units are instantiated separately by GNAT at the end of the processing of the compilation unit. This requires the deferral of the generation of cleanups and finalization actions in enclosing scopes, except for instantiations in generic units where they a

[COMMITTED] ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form

2023-11-21 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, on Windows, file with non-ASCII Latin1 names could be created with Ada.Text_IO.Create by passing "encoding=8bits" through the Form parameter and a Latin1-encoded string through the Name parameter, but calling Ada.Text_IO.Delete on them raised an illegiti

[COMMITTED] ada: Small improvement to Null_Status function

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The function is used to optimize away access checks. gcc/ada/ * sem_util.adb (Null_Status): Deal with unchecked type conversions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[COMMITTED] ada: Fix string indexing within GNAT.Calendar.Time_IO.Value

2023-11-21 Thread Marc Poulhiès
From: Justin Squirek The patch fixes an issue in the compiler whereby calls to GNAT.Calendar.Time_IO.Value where the actual for formal String Date with indexing starting at any value besides one would result in a spurious runtime exception. gcc/ada/ * libgnat/g-catiio.adb (Value): Modif

[COMMITTED] ada: Avoid Style_Checks pragmas affecting other units

2023-11-21 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * par.adb: Restore Style_Checks after parsing each unit. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par.adb | 17 + 1 file changed, 17 insertions(+) diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index 180ec08561c..4e10

[COMMITTED] ada: Compiler crash on container aggregate with loop_parameter_specifications

2023-11-21 Thread Marc Poulhiès
From: Gary Dismukes The compiler crashes on a container aggregate with more than one iterated_element_association given by a loop_parameter_specification. In such a case, the tree contains N_Iterated_Component_Association nodes rather than N_Iterated_Element_Association nodes, and the code for ha

[COMMITTED] ada: Fix issue with indefinite vector of overaligned unconstrained array

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the aligning machinery is not consistently triggered, depending on whether a constrained view or the nominal unconstrained view of the element type is used to perform the allocations and deallocations. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu

[COMMITTED] ada: Another couple of cleanups in the finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou For package specs and bodies that need finalizers, Build_Finalizer is invoked from the Standard scope so it needs to adjust the scope stack before creating new objects; this changes it to do so only once. For other kinds of scopes, it is invoked from Expand_Cleanup_Actions, w

[COMMITTED] ada: Fix type for SPARK expansion on deep delta aggregates

2023-11-21 Thread Marc Poulhiès
From: Yannick Moy gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Aggregate): Fix type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_spark.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index

[COMMITTED] ada: Fix internal error on 'Address of task component

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This happens when the prefix of the selected component is of an access type, i.e. there is an implicit dereference. because the prefix is not resolved. gcc/ada/ * sem_attr.adb (Resolve_Attribute) : Remove the bypass for prefixes with task type. Tested on x86

[COMMITTED] ada: Compiler error reporting illegal prefix on legal loop iterator with "in"

2023-11-21 Thread Marc Poulhiès
From: Gary Dismukes During semantic analysis, the compiler fails to determine the cursor type in the case of a generalized iterator loop with "in", in the case where the iterator type has a parent type that is a controlled type (for example) and its ancestor iterator interface type is given after

[COMMITTED] ada: Small consistency fix for -gnatwv warning

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The goal is to arrange for the warning to be issued consistently between objects whose address is taken and objects whose address is not taken. gcc/ada/ * sem_warn.adb (Check_References.Type_OK_For_No_Value_Assigned): New predicate. (Check_References)

[COMMITTED] ada: Deep delta aggregates in postconditions

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Fix a bug in handling array-valued deep delta aggregates occurring in postconditions. The bug could result in a spurious compilation failure. gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): In the case of a deep delta choice, the expected type for the

[COMMITTED] ada: Fix miscompilation of loop over boolean range

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The optimized form generated in this case turns out to be problematic. gcc/ada/ * gcc-interface/trans.cc (Loop_Statement_to_gnu): Always use the simpler form for a loop with a boolean iteration variable. Tested on x86_64-pc-linux-gnu, committed on master. -

[COMMITTED] ada: Fix predicate failure that occurred in a test case

2023-11-28 Thread Marc Poulhiès
From: Tucker Taft The CodePeer test case illustrating a problem where a "high" precondition failure was expected, died in the GNAT FE on input_reading.adb. The problem was in Check_SCIL, where it didn't properly handle a discriminant_specification. gcc/ada/ * sem_scil.adb: Handle discr

[COMMITTED] ada: Remove dependency on System.Val_Bool in System.Img_Bool

2023-11-28 Thread Marc Poulhiès
From: Yannick Moy In order to facilitate the certification of System.Img_Bool, remove its dependency on unit System.Val_Bool. Modify the definition of ghost function Is_Boolean_Image_Ghost to take the expected boolean value and move it to System.Val_Spec. gcc/ada/ * libgnat/s-imgboo.adb

[COMMITTED] ada: Handle unchecked conversion in bound

2023-11-28 Thread Marc Poulhiès
From: Richard Kenner Look through both unchecked and normal conversions when seeing if any part of a bound is uplevel. gcc/ada/ * exp_unst.adb (Note_Uplevel_Bound): Treat N_Unchecked_Type_Conversion like N_Type_Conversion. Tested on x86_64-pc-linux-gnu, committed on master. --

[COMMITTED] ada: Fix internal error on declare expression in expression function

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou When the expression function is not a completion, its (return) expression does not cause freezing so analyzing the declare expression in this context must not freeze the type of the object. The change also contains another fix, which makes it so that the compiler does not eva

[COMMITTED] ada: Type error on container aggregate with loop_parameter_specification

2023-11-28 Thread Marc Poulhiès
From: Gary Dismukes The compiler incorrectly reported a type error on a container aggregate for a Vector type with a loop_parameter_specification specifying a nonstatic upper bound, complaining that it expected the Vector index type, but instead found type Count_Type. The expansion of the aggrega

[COMMITTED] ada: Add new predicate Is_Address_Compatible_Type

2023-11-28 Thread Marc Poulhiès
From: Sebastian Poeplau When emitting code for architectures with tagged pointers, it is useful to be able to recognize values representing addresses because they require special handling. This commits adds the predicate Is_Address_Compatible_Type, which differs from the node attribute Is_Descend

[COMMITTED] ada: Fix premature finalization for nested return within extended one

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou The return object is incorrectly finalized when the nested return is taken, because the special flag attached to the return object is not updated. gcc/ada/ * exp_ch6.adb (Build_Flag_For_Function): New function made up of the code building the special flag for

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou When transient scopes are being materialized, they can give rise to a block created around the construct being wrapped or not, depending on the kind of construct. In both cases finalization actions for the transient objects of the scope are generated the same way, with normal

[COMMITTED] ada: Fix incorrect quoting in documentation

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * doc/gnat_rm/the_implementation_of_standard_i_o.rst: Fix a couple occurrences of incorrect quoting. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/the_implementation_of_standard_i_o.

[COMMITTED] ada: Errors on instance of Multiway_Trees with discriminated type

2023-11-28 Thread Marc Poulhiès
From: Gary Dismukes The compiler may report various type conflicts on an instantiation of the generic package Ada.Containers.Multiway_Trees with an actual for Element_Type that is a nonprivate actual type with discriminants that has a discriminant-dependent component of a private type (such as a

[COMMITTED] ada: Error compiling reduction expression with overloaded reducer subprogram

2023-11-28 Thread Marc Poulhiès
From: Steve Baird In some cases involving a reduction expression with an overloaded reducer subprogram, the accumulator type is not determined correctly. This can lead to spurious compile-time errors. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): In the case of a Reduc

[COMMITTED] ada: False alarms from -gnatw.t with generic functions

2023-11-28 Thread Marc Poulhiès
From: Bob Duff Disable the warnings generated by -gnatw.t on instances. Otherwise, we get false positives. gcc/ada/ * sem_util.adb (Check_Result_And_Post_State): Disable this when we're in an instance. Misc cleanup. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/

[COMMITTED] ada: Add comment for assertion

2023-11-28 Thread Marc Poulhiès
Add possible cause for a failed assertion. gcc/ada/ * gcc-interface/utils2.cc (build_simple_component_ref): Add comment on assertion. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils2.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-

[COMMITTED] ada: Fix wrong size value output with -gnatR -gnatc

2023-11-28 Thread Marc Poulhiès
From: Eric Botcazou This happens when a parameter is involved in the computation. gcc/ada/ * gcc-interface/decl.cc (annotate_value): Apply the same processing for parameters as for variables. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.c

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-28 Thread Marc Poulhiès
Simon Wright writes: > gcc/ada/Changelog: > > 2023-11-22 Simon Wright > > PR ada/111909 > > Can we commit this one now, please? Hello Simon, Yes we can commit this one, as both Iain and Arnaud ACKed it. I'll create a proper commit with the change and the fixed commit log and merge it. Th

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-28 Thread Marc Poulhiès
Marc Poulhiès writes: > Simon Wright writes: >> gcc/ada/Changelog: >> >> 2023-11-22 Simon Wright >> >> PR ada/111909 >> >> Can we commit this one now, please? > > Hello Simon, > > Yes we can commit this one, as both Iain and Arnaud

[COMMITTED] ada: Constant_Indexing used when context requires a variable

2023-11-30 Thread Marc Poulhiès
From: Steve Baird In the case of a call with a formal parameter of mode other than "IN" where the corresponding actual parameter is a generalized indexing and the indexable container has both Constant_Indexing and Variable_Indexing aspects specified, the generalized indexing must be interpreted a

[COMMITTED] ada: Fix wrong finalization for qualified aggregate of limited type in allocator

2023-11-30 Thread Marc Poulhiès
From: Eric Botcazou This happens with -gnata when the limited type has controlled components and a predicate, because the predicate check generated for the aggregate causes the creation of a temporary that is used as the expression of the allocator. Now this combination is illegal for a limited

[COMMITTED] ada: Fix predicate check failure in Expand_Allocator_Expression

2023-11-30 Thread Marc Poulhiès
From: Eric Botcazou The For_Special_Return_Object flag needs to be accessed on entry of the procedure in case the allocator is rewritten during the processing. gcc/ada/ * exp_ch4.adb (Expand_Allocator_Expression): Add Special_Return boolean constant to hold the value of For_Spec

[COMMITTED] ada: Add comment describing Partition_Elaboration_Policy dependency.

2023-11-30 Thread Marc Poulhiès
From: Steve Baird Add a comment in the spec for the default (as opposed to hie) version of Ada.Real_Time.Timing_Events indicating that it is incompatible with a a Partition_Elaboration_Policy specification specifying a policy other than Concurrent. gcc/ada/ * libgnarl/a-rttiev.ads: add

[COMMITTED] ada: Too-strict conformance checking for formal discriminated type

2023-11-30 Thread Marc Poulhiès
From: Steve Baird The discriminant subtype conformance check for an actual parameter corresponding to a generic formal discriminated type was too strict and could incorrectly reject legal instantiations. gcc/ada/ * sem_ch12.adb (Validate_Discriminated_Formal_Type): Replace Entit

[COMMITTED] ada: Crash initializing component of private record type

2023-11-30 Thread Marc Poulhiès
From: Javier Miranda The compiler may crash processing the full type declaration of a private record type that initializes a component with a call to a function instantiated in the private part of the package. gcc/ada/ * freeze.adb (Declared_In_Expanded_Body): New subprogram. (I

[COMMITTED] ada: Name resolution in expanded instances

2023-11-30 Thread Marc Poulhiès
From: Steve Baird In building the tree for an instance of a generic, expansion sets entity fields on names that refer to things declared outside of the instance, but leaves the entity field unset on names that should end up referring to things declared within the instance. These will instead be s

[COMMITTED] ada: Remove GNATcheck violations

2023-11-30 Thread Marc Poulhiès
From: Sheri Bernstein Remove GNATcheck violations by refactoring code and also using pragma Annotate to exempt them. gcc/ada/ * libgnat/i-cstrin.adb (Free): Rewrite code so there is only one return, to remove Improper_Returns violation. (Position_Of_Nul): Add pragma to e

[COMMITTED] ada: Fix spelling of functions with(out) "side effects"

2023-11-30 Thread Marc Poulhiès
From: Yannick Moy Correct spelling does not include an hyphen. Fix comments and one error message. Also fix other mispellings of "side-effect" or "side effect" depending on the case (adjective should have hyphen), and "side-effect-free" with double hyphen as an adjective. gcc/ada/ * ch

[COMMITTED] ada: Crash processing type invariants on child subprogram

2023-09-19 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * contracts.adb (Has_Public_Visibility_Of_Subprogram): Add missing support for child subprograms. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/contracts.adb | 25 - 1 file changed, 24 insertions(+

[COMMITTED] ada: Refine upper array bound for bit packed array

2023-09-19 Thread Marc Poulhiès
When using bit-packed arrays, the compiler creates new array subtypes of 1-bit component indexed by integers. The existing routine checks the index subtype to find the min/max values. Bit-packed arrays being indexed by integers, the routines gives up as returning the maximum possible integer carrie

[COMMITTED] ada: Private extensions with the keyword "synchronized" are always limited.

2023-09-19 Thread Marc Poulhiès
From: Richard Wai GNAT was relying on synchronized private type extensions deriving from a concurrent interface to determine its limitedness. This does not cover the case where such an extension derives a limited interface. RM-7.6(6/2) makes is clear that "synchronized" in a private extension imp

[COMMITTED] ada: TSS finalize address subprogram generation for constrained...

2023-09-19 Thread Marc Poulhiès
From: Richard Wai ...subtypes of unconstrained synchronized private extensions should take care to designate the corresponding record of the underlying concurrent type. When generating TSS finalize address subprograms for class-wide types of constrained root types, it follows the parent chain lo

[COMMITTED] ada: Clarify RM references that justify a constraint check

2023-09-26 Thread Marc Poulhiès
From: Yannick Moy gcc/ada/ * exp_ch5.adb (Expand_N_Case_Statement): Reference both sections of the Ada RM that deal with case statements and case expressions to justify the insertion of a runtime check. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/ex

[COMMITTED] ada: Make minor corrections to CUDA-related comments

2023-09-26 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ * exp_prag.adb: Make minor corrections in comments. * rtsfind.ads: Remove unused element from RTU_Id definition. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_prag.adb | 8 gcc/ada/rtsfind.ads | 1 - 2 files chan

[COMMITTED] ada: Define CHERI exception types

2023-09-26 Thread Marc Poulhiès
From: Daniel King These exception types map to the CHERI hardware exceptions that are triggered due to misuse of capabilities. gcc/ada/ * libgnat/i-cheri.ads (Capability_Bound_Error) (Capability_Permission_Error, Capability_Sealed_Error) (Capability_Tag_Error): New, defi

[COMMITTED] ada: Fix conversions between addresses and integers

2023-09-26 Thread Marc Poulhiès
From: Daniel King On CHERI targets the size of System.Address and Integer_Address (or similar) are not the same. The operations in System.Storage_Elements should be used to convert between integers and addresses. gcc/ada/ * libgnat/a-tags.adb (To_Tag): Use System.Storage_Elements for

[COMMITTED] ada: Dimensional analysis when used with elementary functions

2023-09-26 Thread Marc Poulhiès
From: Derek Schacht gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst: Add more details on using Generic Elementary Functions with dimensional analysis. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_ugn/gnat_and_prog

[COMMITTED] ada: Fix missing finalization of extended return object on abnormal completion

2023-09-26 Thread Marc Poulhiès
From: Eric Botcazou This happens in the case of a nonlimited return type and is a fallout of the optimization recently implemented for them. gcc/ada/ * einfo.ads (Status_Flag_Or_Transient_Decl): Remove ??? comment. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Extend the

[COMMITTED] ada: Add CHERI variant of System.Stream_Attributes

2023-09-26 Thread Marc Poulhiès
From: Daniel King Reading and writing System.Address to a stream on CHERI targets does not preserve the capability tag; it will always be invalid since a valid capability cannot be created out of thin air. Reading an Address from a stream would therefore never yield a capability that can be deref

[COMMITTED] ada: Fix missing call to Finalize_Protection for simple protected objects

2023-09-26 Thread Marc Poulhiès
From: Eric Botcazou There is a glitch in Exp_Ch7.Build_Finalizer causing the finalizer to do nothing for simple protected objects. The change also removes redundant calls to the Is_Simple_Protected_Type predicate and fixes a minor inconsistency between Requires_Cleanup_Actions and Build_Finalize

[COMMITTED] ada: Update personality function for CHERI purecap

2023-09-26 Thread Marc Poulhiès
From: Daniel King This makes two changes to the GNAT personality function to reflect differences for pure capability CHERI/Morello. The first is to use __builtin_code_address_from_pointer to drop the LSB from Morello code pointers when searching through call-site tables (without this we would nev

[COMMITTED] ada: Crash processing the accessibility level of an actual parameter

2023-09-26 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): When computing the accessibility level of an actual parameter based on the expresssion of a constant declaration, add missing support for deferred constants Tested on x86_64-pc-linux-gnu, committed

[COMMITTED] ada: Fix deferred constant wrongly rejected

2023-09-26 Thread Marc Poulhiès
From: Eric Botcazou This recent regression occurs when the nominal subtype of the constant is a discriminated record type with default discriminants. gcc/ada/ PR ada/110488 * sem_ch3.adb (Analyze_Object_Declaration): Do not build a default subtype for a deferred constant

[COMMITTED] ada: Fix unnesting generated loops with nested finalization procedure

2023-09-26 Thread Marc Poulhiès
The compiler can generate loops for creating array aggregates, for example used during the initialization of variable. If the component type of the array element requires finalization, the compiler also creates a block and a nested procedure that need to be correctly unnested if unnesting is enable

[COMMITTED 6/7] ada: Reject ambiguous function calls in interpolated string expressions

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch2.adb (Analyze_Interpolated_String_Literal): Report interpretations of ambiguous parameterless function calls. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch2.adb | 80 -

[COMMITTED 2/7] ada: Overridden operation field not correctly set for controlling result wrappers

2024-06-27 Thread Marc Poulhiès
From: Martin Clochard Implicit wrapper overridings generated for functions with controlling result when deriving with null extension may have field Overridden_Operation incorrectly set, when making several such derivations in succession. This happens because overridings were assumed to come from

[COMMITTED 3/7] ada: Bug using user defined string literals with interpolated strings

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda The frontend rejects the use of user defined string literals using interpolated strings. gcc/ada/ * sem_res.adb (Has_Applicable_User_Defined_Literal): Add missing support for interpolated strings. Tested on x86_64-pc-linux-gnu, committed on master. --- gc

[COMMITTED 7/7] ada: Remove last uses of System.Address_Operations in runtime library

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This completes the switch from using System.Address_Operations to using only System.Storage_Elements in the runtime library. The remaining uses were for simple optimizations that can be done by the optimizer alone. gcc/ada/ * libgnat/s-carsi8.adb: Remove clauses for

[COMMITTED 4/7] ada: Fix array-manipulating code in Mdll

2024-06-27 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a duo of array assigments in Mdll that were bound to fail. gcc/ada/ * mdll.adb (Build_Non_Reloc_DLL): Fix incorrect assignment to array object. (Ada_Build_Non_Reloc_DLL): Likewise. Tested on x86_64-pc-linux-gnu, committed on mast

[COMMITTED 5/7] ada: Add missing dimension information for target names

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou It is computed from the Etype of N_Target_Name nodes. gcc/ada/ * sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the node once the Etype is set. * sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name. (Analyze_Dimension):

[COMMITTED 1/7] ada: Implement first half of Generalized Finalization

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This implements the first half of the Generalized Finalization proposal, namely the Finalizable aspect as well as its optional relaxed semantics for the finalization operations, but the latter part is only implemented for dynamically allocated objects. In accordance with the

[COMMITTED 02/13] ada: Fix crash on box-initialized component with No_Default_Initialization

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the implementation of the No_Default_Initialization restriction assumes that no type initialization routines are needed and, therefore, builds a dummy version of them, which goes against their use for box-initialized components in aggregates. Therefore thi

[COMMITTED 01/13] ada: Document that -gnatdJ is unused

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * debug.adb (dJ): Add back as unused. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/debug.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index f7fcd399769..3313c4a408f 100644 --- a/gcc/ada/de

[COMMITTED 04/13] ada: Fix bogus error on allocator in instantiation with private derived types

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the call to Convert_View made from Make_Init_Call does nothing because the Etype is not set on the second argument. gcc/ada/ * exp_ch7.adb (Convert_View): Add third parameter Typ and use it if the second parameter does not have an Etype.

[COMMITTED 03/13] ada: Miscomputed bounds for inner null array aggregates

2024-07-02 Thread Marc Poulhiès
From: Javier Miranda When an array has several dimensions, and inner dimmensions are initialized using Ada 2022 null array aggregates, the compiler crashes or reports spurious errors computing the bounds of the null array aggregates. This patch fixes the problem and adds new warnings reported whe

[COMMITTED 06/13] ada: Call memcmp instead of Compare_Array_Unsigned_8 and...

2024-07-02 Thread Marc Poulhiès
From: Eric Botcazou ... implement support for ordering comparisons of discrete array types. This extends the Support_Composite_Compare_On_Target feature to ordering comparisons of discrete array types as specified by RM 4.5.2(26/3), when the component type is a byte (unsigned). Implement suppor

[COMMITTED 05/13] ada: Fix analysis of Extensions_Visible

2024-07-02 Thread Marc Poulhiès
From: Yannick Moy Pragma/aspect Extensions_Visible should be analyzed before any pre/post contracts on a subprogram, as the legality of conversions of formal parameters to classwide type depends on the value of Extensions_Visible. Now fixed. gcc/ada/ * contracts.adb (Analyze_Pragmas_In_

[COMMITTED 07/13] ada: Bug box for expression function with list comprehension

2024-07-02 Thread Marc Poulhiès
From: Bob Duff GNAT crashes on an iterator with a filter inside an expression function that is the completion of an earlier spec. gcc/ada/ * freeze.adb (Freeze_Type_Refs): If Node is in N_Has_Etype, check that it has had its Etype set, because this can be called early fo

[COMMITTED 09/13] ada: Put_Image aspect spec ignored for null extension.

2024-07-02 Thread Marc Poulhiès
From: Steve Baird If type T1 is is a tagged null record with a Put_Image aspect specification and type T2 is a null extension of T1 (with no aspect specifications), then evaluation of a T2'Image call should include a call to the specified procedure (as opposed to yielding "(NULL RECORD)"). gcc/a

<    1   2   3   4   5   6   7   8   9   10   >