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

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][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

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] 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

[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

[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. ---

[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. *

[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

[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,

[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

[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

[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

[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 "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 +-

[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: 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

[COMMITTED] ada: Fix extra whitespace after END keywords

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Style cleanup. gcc/ada/ * exp_pakd.adb, libgnarl/s-osinte__android.ads, libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads, libgnat/s-gearop.adb, libgnat/s-poosiz.adb, sem_util.adb: Fix style. Tested on

[COMMITTED] ada: Fix debug info for aliased packed array with unconstrained nominal subtype

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou The front-end now rewrites it as a renaming when it is initialized with a function call and the same processing must be applied in the renaming case as in the regular case for this kind of special objects. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) :

[COMMITTED] ada: Fix incorrect resolution of overloaded function call in instance

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou The problem occurs when the function call is the operand of an equality operator, the type used to do the comparison is declared outside of the generic construct but visible inside it, and this generic construct also declares two functions with the same profile except for the

[COMMITTED] ada: Simplify handling of known values in expansion of packed arrays

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek If an expression value is not known at compile time, it can be represented with No_Uint and doesn't require a dedicated flag. Code cleanup; behavior is unaffected. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove Rhs_Val_Known; represent

[COMMITTED] ada: Simplify expansion of packed array assignments

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek When expanding assignment to a packed array object, e.g. a formal parameter with mode OUT that might have unconstrained type, we took the component type and component size from the constrained actual subtype. It is simpler to take these properties from the nominal type of

[COMMITTED] ada: Avoid extra conversion in expansion of packed array assignments

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Expansion of assignments to packed array objects with string literals on the right-hand side, created an unnecessary conversion, i.e.: ... := component_type (declare temp : component_type := "string_literal"; begin temp) Now the

[COMMITTED] ada: Fix expansion of type aspects with handling of aspects

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek The new handling of aspects stores the aspect expression as the Expression_Copy of the aspect and not as the Entity of the aspect identified. This has been changed for most of the aspects, but not for Type_Invariant and Default_Initial_Condition, which have custom expansion.

[COMMITTED] ada: Change local variables to constants in expansion of packed arrays

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Cleanup; semantics is unaffected. gcc/ada/ * exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change local Decl object from variable to constant. (Setup_Inline_Packed_Array_Reference): Likewise for Csiz. Tested on x86_64-pc-linux-gnu,

[COMMITTED] ada: Error in prefix-notation call

2023-11-07 Thread Marc Poulhiès
From: Bob Duff The compiler gives a wrong error for a call of the form X.Y(...) when Y is inherited indirectly via an interface. gcc/ada/ * sem_ch4.adb (Is_Private_Overriding): Return True in the case where a primitive operation is publicly inherited but privately

[COMMITTED] ada: Fix handling of actual subtypes for expanded names

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek gcc/ada/ * sem_util.adb (Get_Actual_Subtype,Get_Actual_Subtype_If_Available): Fix handling of expanded names. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[COMMITTED] ada: Fix style in declaration of routine for expansion of packed arrays

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Style cleanup. gcc/ada/ * exp_pakd.adb (Setup_Inline_Packed_Array_Reference): Remove extra whitespace from the list of parameters. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_pakd.adb | 20 ++-- 1 file changed, 10

[COMMITTED] ada: Cleanup getting of actual subtypes

2023-11-07 Thread Marc Poulhiès
From: Piotr Trojanek Avoid potentially unnecessary call to Etype. gcc/ada/ * sem_util.adb (Get_Actual_Subtype_If_Available): Only call Etype when necessary. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 4 +--- 1 file changed, 1 insertion(+),

[COMMITTED] ada: Simplify code for Ignore_Style_Checks_Pragmas

2023-11-07 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * sem_prag.adb: (Analyze_Pragma): Reduce the number of nested if statements. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git

[COMMITTED] ada: Fix scope of semantic style_check pragmas

2023-11-07 Thread Marc Poulhiès
From: Viljar Indus Restore the original state of Style_Check pragmas before analyzing each compilation unit to avoid Style_Check pragmas from unit affecting the style checks of a different unit. gcc/ada/ * sem_ch10.adb: (Analyze_Compilation_Unit): Restore the orignal state of

[COMMITTED] ada: Fix internal error on address of element of packed array component

2023-11-07 Thread Marc Poulhiès
From: Eric Botcazou This occurs when the component is part of a discriminated type and its offset depends on a discriminant, the problem being that the front-end generates an incomplete Bit_Position attribute reference. gcc/ada/ * exp_pakd.adb (Get_Base_And_Bit_Offset): Use the full

[PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib

2023-11-06 Thread Marc Poulhiès
Contrary to glibc, including stdio.h from newlib defines mode_t which conflicts with the test's type definition. .../gcc/testsuite/gcc.dg/analyzer/fd-4.c:19:3: error: redefinition of typedef 'mode_t' with different type ... .../include/sys/types.h:189:25: note: previous declaration of 'mode_t'

[PATCH] testsuite: require avx_runtime for some tests

2023-11-06 Thread Marc Poulhiès
These 3 tests fails parsing the 'vect' dump when not using -mavx. Make the dependency explicit. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-ifcvt-18.c: Add dep on avx_runtime. * gcc.dg/vect/vect-simd-clone-16f.c: Likewise. * gcc.dg/vect/vect-simd-clone-18f.c: Likewise.

[PATCH] testsuite: skip gcc.target/i386/pr106910-1.c test when using newlib

2023-11-06 Thread Marc Poulhiès
Using newlib produces a different codegen because the support for c99 differs (see libc_has_function hook). gcc/testsuite/ChangeLog: * gcc.target/i386/pr106910-1.c: Disable for newlib. --- Tested on x86_64-linux and x86_64-elf. OK for master? gcc/testsuite/gcc.target/i386/pr106910-1.c

[COMMITTED] ada: Refactor code to remove GNATcheck violation

2023-10-19 Thread Marc Poulhiès
From: Sheri Bernstein Rewrite for loop containing an exit (which violates GNATcheck rule Exits_From_Conditional_Loops), to use a while loop which contains the exit criteria in its condition. Also, move special case of first time through loop, to come before loop. gcc/ada/ *

[COMMITTED] ada: Add pragma Annotate for GNATcheck exemptions

2023-10-19 Thread Marc Poulhiès
From: Sheri Bernstein Exempt the GNATcheck rule "Unassigned_OUT_Parameters" with the rationale "the OUT parameter is assigned by component". gcc/ada/ * libgnat/s-imguti.adb (Set_Decimal_Digits): Add pragma to exempt Unassigned_OUT_Parameters.

[COMMITTED] ada: Document gnatbind -Q switch

2023-10-19 Thread Marc Poulhiès
From: Patrick Bernardi Add documentation for the -Q gnatbind switch in GNAT User's Guide and improve gnatbind's help output for the switch to emphasize that it adds the requested number of stacks to the secondary stack pool generated by the binder. gcc/ada/ * bindusg.adb (Display):

[COMMITTED] ada: Seize opportunity to reuse List_Length

2023-10-19 Thread Marc Poulhiès
From: Ronan Desplanques This patch is intended as a readability improvement. It doesn't change the behavior of the compiler. gcc/ada/ * sem_ch3.adb (Constrain_Array): Replace manual list length computation by call to List_Length. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Simplify "not Present" with "No"

2023-10-19 Thread Marc Poulhiès
From: Piotr Trojanek gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Simplify with "No". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb

[COMMITTED] ada: Fix filesystem entry filtering

2023-10-10 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes the behavior of Ada.Directories.Search when being requested to filter out regular files or directories. One of the configurations in which that behavior was incorrect was that when the caller requested only the regular and special files but not the

[COMMITTED] ada: Fix internal error on too large representation clause for small component

2023-10-10 Thread Marc Poulhiès
From: Eric Botcazou This is a small bug present on strict-alignment platforms for questionable representation clauses. gcc/ada/ * gcc-interface/decl.cc (inline_status_for_subprog): Minor tweak. (gnat_to_gnu_field): Try harder to get a packable form of the type for a

[COMMITTED] ada: Fix infinite loop with multiple limited with clauses

2023-10-10 Thread Marc Poulhiès
From: Eric Botcazou This occurs when one of the types has an incomplete declaration in addition to its full declaration in its package. In this case AI05-129 says that the incomplete type is not part of the limited view of the package, i.e. only the full view is. Now, in the GNAT implementation,

[COMMITTED] ada: Tweak internal subprogram in Ada.Directories

2023-10-10 Thread Marc Poulhiès
From: Ronan Desplanques The purpose of this patch is to work around false-positive warnings emitted by GNAT SAS (also known as CodePeer). It does not change the behavior of the modified subprogram. gcc/ada/ * libgnat/a-direct.adb (Start_Search_Internal): Tweak subprogram body.

[COMMITTED] ada: Remove superfluous setter procedure

2023-10-10 Thread Marc Poulhiès
From: Eric Botcazou It is only called once. gcc/ada/ * sem_util.ads (Set_Scope_Is_Transient): Delete. * sem_util.adb (Set_Scope_Is_Transient): Likewise. * exp_ch7.adb (Create_Transient_Scope): Set Is_Transient directly. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Fix bad finalization of limited aggregate in conditional expression

2023-10-10 Thread Marc Poulhiès
From: Eric Botcazou This happens when the conditional expression is immediately returned, for example in an expression function. gcc/ada/ * exp_aggr.adb (Is_Build_In_Place_Aggregate_Return): Return true if the aggregate is a dependent expression of a conditional

[COMMITTED] ada: Tweak documentation comments

2023-10-10 Thread Marc Poulhiès
From: Ronan Desplanques The concept of extended nodes was retired at the same time Gen_IL was introduced, but there was a reference to that concept left over in a comment. This patch removes that reference. Also, the description of the field Comes_From_Check_Or_Contract was incorrectly placed

[COMMITTED] ada: Crash processing pragmas Compile_Time_Error and Compile_Time_Warning

2023-10-10 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_attr.adb (Analyze_Attribute): Protect the frontend against replacing 'Size by its static value if 'Size is not known at compile time and we are processing pragmas Compile_Time_Warning or Compile_Time_Errors. Tested on

[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

[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: 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] 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

[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

[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

[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: 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. ---

[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: 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,

[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

[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. ---

[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

[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

[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

[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

Re: [PATCH 1/2 v3] Ada: Synchronized private extensions are always limited

2023-09-18 Thread Marc Poulhiès via Gcc-patches
Hello Richard, > I have added the required “Signed-off-by” tag to the patch and to the change > log > entry below. I believe for all other aspects I have followed the instructions. Thanks for doing these modifications. I believe you have read the Developer's Certificate of Origin

[PATCH] Trivial typo fix in variadic

2023-09-17 Thread Marc Poulhiès via Gcc-patches
. Signed-off-by: Marc Poulhiès --- Hi, I came across this trivial typo and fixed it. The compiler still builds correctly. I've bootstraped x86_64-linux. As I don't really know how to setup nvptx correctly (and not sure this trivial fix warrants learning the full setup...), I've simply built

[COMMITTED] ada: Explicitly analyze and expand null array aggregates

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Null array aggregates have present but empty lists of expressions and component associations. This confuses the previous code for ordinary array aggregates, which assumes that if a list of either expressions or component associations is present, then it is non-empty. This

[COMMITTED] ada: Fix minor glitch in finish_record_type

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The size needs to be rounded up to the storage unit in all cases. gcc/ada/ * gcc-interface/utils.cc (finish_record_type): Round the size in the padding case as well. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils.cc |

[COMMITTED] ada: Fix internal error on misaligned component with variable nominal size

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The back-end cannot handle this kind of components even when they are small. gcc/ada/ * exp_util.adb (Component_May_Be_Bit_Aligned): Do not return false for a small component of a record type with a variant part. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Fix wrong optimization of extended return for discriminated record type

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This happens when the discriminants of the record type have default values. gcc/ada/ChangeLog: * inline.adb (Expand_Inlined_Call): In the case of a function call that returns an unconstrained type and initializes an object, set the No_Initialization

[COMMITTED] ada: Remove GNAT Pro details regarding mold

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Kévin Le Gouguec gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove extended discussion regarding mold run-time dependencies; packaging changes in GNAT Pro have made them obsolete. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Generate runtime restrictions list when the standard library is suppressed

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Patrick Bernardi With the introduction of Jorvik support into the light-tasking runtime comes the requirement to detect voliations of runtime restrictions (for example Max_Entry_Queue_Length) where previously they could be hard coded in the runtime. This means we now need the binder to

[COMMITTED] ada: Do not perform local-exception-to-goto optimization on barrier functions

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Patrick Bernardi The local-exception-to-goto optimization is no longer applied to entry barrier functions as entry barriers cannot contain exception handlers and this optimization interferes with another optimization that occurs for simple barrier functions. In particular, the simple

[COMMITTED] ada: Fix internal error on expression function with Refined_Post aspect

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This occurs when the expression function calls a protected function and the -gnata switch is specified, because the compiler wrongly freezes the called function when analyzing the expression function, a fallout of the wrapping scheme used for the Post and Refined_Post

[COMMITTED] ada: Fix internal error on aggregate nested in container aggregate

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This handles the case where a component association is present. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): In the case of a component association, call Is_Container_Aggregate on the parent's parent. (Expand_Array_Aggregate): Likewise.

[COMMITTED] ada: Clean up scope depth and related code (tech debt)

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff The main point of this patch is to remove the special case for Atree.F_Scope_Depth_Value in the Assert that Field_Present in Get_Field_Value. Pulling on that thread leads to lots of related cleanup. gcc/ada/ChangeLog: * atree.adb (Node_Kind_Table): Specify parameter

[COMMITTED] ada: Crash on creation of extra formals on type extension

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda Revert previous patch and fix the pending issue. gcc/ada/ * accessibility.ads (Needs_Result_Accessibility_Extra_Formal): Removed. * accessibility.adb (Needs_Result_Accessibility_Level_Param): Removed.

[COMMITTED] ada: Assertion failure on expansion of record with invariant

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_util.adb (Process_Record_Component): Adjust assertion on the availablity of the invariant procedure; required because the invariant procedure is built by the expander, and hence it is not available compiling generic units or

[COMMITTED] ada: Assertion failure on calculation of Large_Max_Size_Mutable

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * sem_util.adb (Large_Max_Size_Mutable): Protect access to attribute Is_Array_Type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[COMMITTED] ada: Fix late finalization for function call in delta aggregate

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The problem occurs at library level because the temporary created for the function call lives in the elaboration routine but is finalized only when the package itself is. It turns out that there is no need for this temporary, since the expansion of delta aggregates already

[COMMITTED] ada: Improve detection of deactivated code for warnings with -gnatwt

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Switch -gnatwt is used in GNAT to track deleted code. It can be emitted by GNAT on code that is intentionally deactivated for a given configuration. The current test to suppress spurious warnings is not complex enough to detect all such cases. Now improved, by using the same

[COMMITTED] ada: Assertion failure on for-of loop iterating on selected component

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Protect access to Entity attribute and add missing code to check function selector in a prefix form call. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Fix premature finalization in loop over limited iterable container

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This happens when the iterable container is obtained as the result of a call to a function that is a subprogram parameter of a generic construct. gcc/ada/ * exp_util.adb (Initialized_By_Aliased_BIP_Func_Call): Make the name matching more robust. Tested on

[COMMITTED] ada: Assertion failure adding extra formals to late overriding subp.

2023-09-14 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * sem_ch6.adb (Parent_Subprogram): Complete assertion. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index

Re: [PING][PATCH] LoongArch: initial ada support on linux

2023-09-05 Thread Marc Poulhiès via Gcc-patches
Yujie Yang writes: > Hi Marc, > > Thank you for the review! > > We added -gnatea and -gnatez to CC1_SPECS for correct multilib handling, > and I believe this is currently specific to LoongArch. > > LoongArch relies on the GCC driver (via self_specs rules) to generate a > canonicalized tuple of

[COMMITTED] ada: Elide the copy in extended returns for nonlimited by-reference types

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu): Really test Storage_Pool on the simple return statement. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/trans.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[COMMITTED] ada: Fix spurious warning emissions

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Before this patch, warnings handled by `Sem_Warn.Check_References` were erroneously emitted in some cases. Here is an example of a program that, when compiled with the `-gnatwu` switch, triggered the bug: procedure Main is package T is A : Integer;

[COMMITTED] ada: Support setting task affinity on QNX

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Johannes Kliemann QNX does not support setting the thread affinity via a POSIX API. This implementation uses QNX's native Thread_Ctl API to set the thread affinity for Ada tasks. gcc/ada/ * libgnarl/s-taprop__qnx.adb: Implement Set_Task_Affinity. Tested on x86_64-pc-linux-gnu,

[COMMITTED] ada: building_executable_programs_with_gnat.rst: fix -gnatw.x index

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Ghjuvan Lacambre The index for this paragraph was wrong. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix index. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Remove redundant protection against empty list

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Calls to First on No_List intentionally return Empty, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. gcc/ada/ * sem_type.adb (Interface_Present_In_Ancestor): Remove guard against no list of interfaces; fix style

[COMMITTED] ada: Fix problematic secondary stack management in protected entry

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The secondary stack mark goes formally out of scope before the finalizer reads it to reclaim the storage. gcc/ada/ * exp_ch9.adb (Build_Protected_Entry): Move the At_End procedure from the entry body to the inner block statement. Tested on

[COMMITTED] ada: Preserve capability validity in address arithmetic

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Daniel King On CHERI targets where System.Address is a capability, arithmetic on addresses should avoid converting to integers and instead use the operations defined in System.Storage_Elements to perform the arithmetic directly on the System.Address object. This preserves the capability's

[COMMITTED] ada: Add guard before querying the type for its interfaces

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Fix crash on illegal code, when routine Iface_Present_In_Ancestor is called on the predefined String type and attempts to examine the list of interfaces. gcc/ada/ * sem_type.adb (Iface_Present_In_Ancestor): Only look at the list of interfaces for types that

[COMMITTED] ada: Fix DWARF for certain arrays

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Tom Tromey An array whose index type is a nonstandard enum will be marked as "packed", but should not emit DW_AT_bit_stride unless it is also bit-packed. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Set bit-packed for constrained and unconstrained array types.

[COMMITTED] ada: Remove TBC comment, no more needed

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Liaiss Merzougue gcc/ada/ * libgnat/s-imguti.adb: Remove comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-imguti.adb | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/ada/libgnat/s-imguti.adb b/gcc/ada/libgnat/s-imguti.adb index

[COMMITTED] ada: Fix internal error on instantiation with private component type

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou First, this fixes an internal error on the instantiation of a nested generic package taking an array type whose component type is a private type declared in the parent package as formal type parameter. In the body of the instance, the full view of the private type is visible

[COMMITTED] ada: Remove redundant guard against an empty list of interfaces

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_type.adb (Iface_Present_In_Ancestor): Remove guard for empty list of interfaces; the following loop will work just fine without it. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Crash on creation of extra formals on type extension

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler blows up processing an overriding dispatching function of a derived tagged type that returns a private tagged type that has an access type discriminant. gcc/ada/ * accessibility.ads (Needs_Result_Accessibility_Extra_Formal): New subprogram.

[COMMITTED] ada: Handle GNATcheck violations

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Sheri Bernstein For the GNATcheck rule "Improper_Returns", either use pragma Annotate to exempt the violation with the rationale "early returns for performance", or refactor the code by replacing multiple returns by a single return statement with a conditional expression; this is more

[COMMITTED] ada: Pass -msmp when linking for ppc-vx6 --RTS=rtp-smp

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Alexandre Oliva gprbuild and gnatmake won't pass --RTS=rtp-smp to the compiler driver for linking. The flag was not used during linking: the .spec files named as linker options were all we passed for the linker to get the -L flags for lib_smp and lib. There was a problem, though:

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