[COMMITTED] ada: Better error message for bad Discard_Names configuration pragma

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird When a pragma Discard_Names is used as a configuration pragma, it does not take an argument. If an argument is given, the resulting error message was incorrect and confusing. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Fix Is_Configuration_Pragma function to hand

[COMMITTED] ada: Fix generic instantiation of sibling package

2023-01-05 Thread Marc Poulhiès via Gcc-patches
The compiler would crash because it is failing at setting up the scope stack correctly for a generic instantiation of a sibling package within a child package instance. In this case, the parent instance isn't explicitly referenced and it must be found differently. gcc/ada/ * sem_ch12.adb

[COMMITTED] ada: Revert to constrained allocation for string concatenation

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Using an unconstrained allocation is less efficient in the general case. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): New local variable used throughout instead of testing Is_Special_Return_Object every time. Do not rename an OK_To_Rename obj

[COMMITTED] ada: Simplify new expansion of contracts

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou We can now use an extended return statement in all cases since it no longer generates an extra copy for nonlimited by-reference types. gcc/ada/ * contracts.adb (Build_Subprogram_Contract_Wrapper): Generate an extended return statement in all cases. (E

[COMMITTED] ada: Fix pasto in comment

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Fix pasto in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb

[COMMITTED] ada: Further adjust freezing for expansion of contracts

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This further adjusts a test deciding whether to freeze an entity coming from an outer scope in an inner scope based on language rules, to the presence of the new internal subprogram generated because of post-conditions. gcc/ada/ * freeze.adb (Freeze_Entity): For the

[COMMITTED] ada: Do not use decimal approximation in -gnatRj output

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This avoids an unnecessary loss of precision for real values. gcc/ada/ * repinfo.ads (The JSON output format): Document change. * urealp.adb (UR_Write_To_JSON): Output a fraction instead of a decimal approximation. Tested on x86_64-pc-linux-gnu, comm

[COMMITTED] ada: Fix spurious emissions of -gnatwj warning

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Before this patch, the compiler would erroneously emit a warning about the use of parentheses for array aggregates being discouraged in some situations. Those situations were the ones where array aggregates were used as generic actuals when instantiating generic packages d

[COMMITTED] ada: Update gnatpp documentation with --layout switch

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Joao Azevedo Update legacy switches. gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: add gnatpp --layout switch and update legacy switches. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc/gnat_ugn/gnat_utility_programs.rst| 831 +++---

[COMMITTED] ada: Flag renaming-as-spec as a body to inline

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek For GNAT the frontend is only inlining subprograms with explicit specs, including specs completed with renaming-as-body. For GNATprove the frontend must also inline renamings acting as specs. Otherwise, we will try to build a body-to-inline with code that is can't handle unus

[COMMITTED] ada: Optimize class-wide objects initialized with function calls

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This optimizes the implementation of class-wide objects initialized with function calls in the non-interface case, by avoiding an unnecessary copy operation and/or a dispatching call to the _Size primitive when possible. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declar

[COMMITTED] ada: INOX: prototype RFC on String Interpolation

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda This patch incorporates a prototype for a new string literal syntax which supports the use of "string interpolation," where the names of variables or expressions can be used directly within the string literal, such that the value of the variable or the expression is "interpol

[COMMITTED] ada: Fix nested generic instantiation

2023-01-05 Thread Marc Poulhiès via Gcc-patches
Previous fix for generic instantiation was not precise enough and could wrongly assume the instantiation node to be an N_Expanded_Name. gcc/ada/ * sem_ch12.adb (Instantiate_Package_Body): Better filtering when installing parent on the scope stack. Tested on x86_64-pc-linux-gnu, c

[COMMITTED] ada: Clean up interface handling in Expand_N_Object_Declaration

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The code performing the expansion of objects with (class-wide) interface type in Expand_N_Object_Declaration is fairly low-level, fiddling with the homonym and entity chains, which is unnecessary. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Rewrite the end

[COMMITTED] ada: Remove unhelpful special case for renamed bodies in GNATprove mode

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek This patch reverts a special-case related to inlining of renamed bodies in GNATprove mode. Its idea was that inlining is decided in routine Cannot_Inline, which is called much later. This didn't quite work, because in the meantime the renamed body was prepared to inlining in

[COMMITTED] ada: Minor tweak to test added in previous change

2023-01-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This changes the test to use the common idion of the codebase. gcc/ada/ * exp_util.adb (Make_CW_Equivalent_Type) : Tweak. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[COMMITTED] ada: Simplify finalization of temporaries created for interface objects

2023-01-09 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The expansion of (class-wide) interface objects generates a temporary that holds the actual data and the objects are rewritten as the renaming of the dereference at the interface tag present in it. These temporaries may need to be finalized and this is currently done through t

[COMMITTED] ada: Remove a couple of unreachable statements

2023-01-09 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The "then" arm of these nested if-statements is trivially unreachable. gcc/ada/ * exp_ch7.adb (Make_Adjust_Call): Remove unreachable statement. (Make_Final_Call): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 12 ++

ada: Update copyright notice

2023-01-09 Thread Marc Poulhiès via Gcc-patches
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * accessibility.adb, accessibility.ads, ada_get_targ.adb: Update copyright year. * adabkend.adb, adabkend.ads, adadecode.c, adadecode.h, adaint.c: Likewise. * adaint.h, affinity.c, ali-util.adb, ali-util.ads, a

[COMMITTED] ada: Optimize interface objects initialized with function calls

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This optimizes the implementation of (class-wide) interface objects that are initialized with function calls, by avoiding an unnecessary copy operation. This also removes useless access checks generated by the expansion of return statements involving class-wide types. gcc/ada

[COMMITTED] ada: Lift restriction on optimization of aliased objects

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou It turns out that the only blocking case is an aliased object whose nominal subtype is an unconstrained array because the bounds must be allocated. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): Also optimize aliased objects if their nominal subtype is

[COMMITTED] ada: Fix premature finalization of temporaries for interface objects

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This restores the proper finalization of temporaries for interface objects in the case where the initializing expression is not of an interface type. It turns out that neither Is_Temporary_For_Interface_Object nor its previous incarnation are sufficient to catch all the vario

[COMMITTED] ada: Use static references to tag in more cases for interface objects

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This extends the use of static references to the interface tag in more cases for (class-wide) interface objects, e.g. for initialization expressions that are qualified aggregates or nondispatching calls returning a specific tagged type implementing the interface. gcc/ada/

[COMMITTED] ada: Further optimize interface objects initialized with function calls

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This further optimizes the usual case of (class-wide) interface objects that are initialized with calls to functions whose result type is the type of the objects (this is not necessary as any result type implementing the interface would do) by avoiding a back-and-forth displac

[COMMITTED] ada: Put back conversion to interface in more cases

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This needs to be done for all expressions with class-wide type. gcc/ada/ * exp_ch3.adb (Make_Allocator_For_Return): Put back an interface conversion for expressions with non-interface class-wide type. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Fix benign pasto in new predicate

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * exp_util.adb (Make_CW_Equivalent_Type.Has_Tag_Of_Type): Fix pasto. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.ad

[COMMITTED] ada: Fix pessimization of some CW objects initialized with function call

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The recent removal of the unconditional call to Remove_Side_Effects on the expression of an object declaration or an allocator with a class-wide type has introduced a pessimization in the former case for function calls that return a specific tagged type, because the object ult

[COMMITTED] ada: Update copyright years.

2023-01-16 Thread Marc Poulhiès via Gcc-patches
gcc/ada/ * gcc-interface/Make-lang.in: Update copyright years. * gcc-interface/Makefile.in: Likewise. * gcc-interface/ada-builtin-types.def: Likewise. * gcc-interface/ada-builtins.def: Likewise. * gcc-interface/ada-tree.def: Likewise. * gcc-interface

[COMMITTED] ada: Fix latent bug exposed by recent work on extended return statements

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou When the type of the return object is a constrained array, there may be an implicit sliding that needs to be preserved during the expansion. gcc/ada/ * exp_ch3.adb (Make_Allocator_For_Return): Convert the expression to the return object's type in the constrai

[COMMITTED] ada: Fix typo in comment

2023-01-16 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * exp_ch3.adb (Make_Allocator_For_Return): Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index

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

2023-08-31 Thread Marc Poulhiès via Gcc-patches
Yang Yujie writes: Hello Yujie, > gcc/ChangeLog: > > * ada/Makefile.rtl: Add LoongArch support. > * ada/libgnarl/s-linux__loongarch.ads: New. > * ada/libgnat/system-linux-loongarch.ads: New. > * config/loongarch/loongarch.h: mark normalized options > passed from d

[PATCH v3] mklog: handle Signed-off-by, minor cleanup

2023-09-03 Thread Marc Poulhiès via Gcc-patches
Richard Sandiford via Gcc-patches writes: >> +# this regex matches the first line of the "end" in the initial commit >> message >> +FIRST_LINE_OF_END_RE = re.compile('(?i)^(signed-off-by|co-authored-by|#): ') > > The current code only requires an initial "#", rather than an initial "#: ". > Is th

[COMMITED v4] mklog: handle Signed-off-by, minor cleanup

2023-09-04 Thread Marc Poulhiès via Gcc-patches
Consider Signed-off-by lines as part of the ending of the initial commit to avoid having these in the middle of the log when the changelog part is injected after. This is particularly usefull with: $ git gcc-commit-mklog --amend -s that can be used to create the changelog and add the Signed-off

[COMMITTED] Revert "Adjust one Ada test"

2023-09-05 Thread Marc Poulhiès via Gcc-patches
This reverts commit d8dc61bb5ab99c3239ea93a37097f9419bee0211. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/gnat.dg/unroll3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gnat.dg/unroll3.adb b/gcc/testsuite/gnat.dg/unroll3.adb index

[COMMITTED] ada: Enforce subtype conformance of interface primitives

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * sem_ch3.adb (Add_Internal_Interface_Entities): Add missing subtype-conformance check on primitives implementing interface primitives. (Error_Posted_In_Formals): New subprogram. Tested on x86_64-pc-linux-gnu, committed on master. -

[COMMITTED] ada: Remove GNATcheck violations

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Sheri Bernstein Use pragma Annotate to exempt GNATcheck violations that are related to proof code. Specifically, exempt rules "Metrics_LSLOC" and "Metrics_Cyclomatic_Complexity" whose limits are exceeded due to proof code, and exempt rule "Discriminated_Records" for a variant record that is

[COMMITTED] ada: Add missing units to Makefile.rtl

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques A previous change accidently removed a-cohama and a-cohase from `Makefile.rtl`. This patch adds these units back gcc/ada/ * Makefile.rtl: Add missing units. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/Makefile.rtl | 2 ++ 1 file changed, 2

[COMMITTED] ada: Fix assertion failure on very peculiar enumeration type

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The compiler currently does not support the combination of a representation clause on an enumeration type with a size clause whose value is greater than the size of the largest machine scalar supported by the target. Given that such a type would have little practical value, t

[COMMITTED] ada: Tweak comment about tasking corner case

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This patch adjusts a comment that could have misleadingly suggested that a corner case related to tasks could not exist in Ada 2012 or Ada 2022. gcc/ada/ * libgnarl/s-tassta.adb: Tweak comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/li

[COMMITTED] ada: Compiler hangs on invalid postcondition

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird In some cases involving an illegal reference to F'Result in the postcondition for a function not named F, the compiler would hang instead of correctly diagnosing the error. gcc/ada/ * sem_attr.adb (Denote_Same_Function): Handle the case where Has_Homonym (Pref_

[COMMITTED] ada: Crash on function returning empty Ada 2022 aggregate

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler crashes processing a function that returns an empty aggregate when its returned type is a record type which defined its container aggregate aspects. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Report warning on infinite recursion if an

[COMMITTED] ada: Spurious warning about negative modular literal

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird If -gnatw.m is enabled, the compiler generates a warning if a unary minus operator of a modular type is applied to an integer literal. This warning was being incorrectly generated in some cases where no integer literal is present in the source code. gcc/ada/ * sem_res.

[COMMITTED] ada: Fix crash on selected component lookup in generic instance

2023-09-05 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch fixes a compiler crash on selected component lookup in an instance of a generic unit when the relevant type is an itype. gcc/ada/ * sem_ch4.adb (Find_Component_In_Instance): Check that Declaration_Node (Par) is not Empty, as it is for itypes. Tested on

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

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

[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: 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. --- gcc/ada/sem_t

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

[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 2e69e630c8a

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

[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 x86_64-pc-linux-gn

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

[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. --- .../doc/gnat_ugn/building_executable_prog

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

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

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 p

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

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

[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. --- gcc/ada/sem_util.a

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

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

[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 a/gcc/ada/sem_uti

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

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

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

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

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

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

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

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

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

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

[PATCH] Trivial typo fix in variadic

2023-09-17 Thread Marc Poulhiès via Gcc-patches
Fix all occurences of varadic, except for Rust (will be part of another change). gcc/ChangeLog: * config/nvptx/nvptx.h (struct machine_function): Fix typo in variadic. * config/nvptx/nvptx.cc (nvptx_function_arg_advance): Adjust to use fixed name. (nvptx_declare_function_

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 (https://gcc.

[COMMITTED] ada: Generate host-side CUDA_Register_Function calls for device's adainit/adafinal

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird To invoke a device-side subprogram from the host (via a CUDA_execute pragma), the subprogram also has to be registered by calling CUDA_Register_Function. The host-side adainit and adafinal procedures need to invoke the corresponding device-side procedures, so corresponding CUDA_

[COMMITTED] ada: Reject expanded global names in lock-free protected objects

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Lock-free expansion of protected subprograms is only possible when there are no references to global assignable objects. We only detected such references when they appeared as direct names, but we must similarly detect expanded names. gcc/ada/ * sem_ch9.adb (Satisfi

[COMMITTED] ada: Support lock-free protected objects with pragma Initialize_Scalars

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek In general, protected subprograms are only eligible for a lock-free expansion if they do not reference global assignable objects. However, it seems reasonable to ignore references to variables in System.Scalar_Values, which are generated when pragma Initialize_Scalars is act

[COMMITTED] ada: Remove VxWorks 6 and VxWorks 653 2.x content from the UGX

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Cedric Landet Because they are not supported anymore. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Remove VxWorks version 6. * gnat_rm.texi, gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/impl

[COMMITTED] ada: Generate missing object decls for adainit/adafinal registration calls

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird A previous change on this ticket introduced calls to CUDA_Register_Function for adainit and adafinal, but failed to introduce declarations for the C string variables that are initialized and then passed as actual parameters in this call. Provide the missing declarations (and, in

[COMMITTED] ada: Allow enabling a restricted set of language extensions.

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird The -gnatX switch (and the related Extensions_Allowed pragma) is currently a two-valued all-or-nothing option. Add support for enabling a curated subset of language extensions without enabling others via the -gnatX switch and for enabling all language extensions via the new -gna

[COMMITTED] ada: Fix various typos in node and entity description comments

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Fix typos in units that describe GNAT abstract syntax tree. gcc/ada/ * einfo.ads: Fix typos in comments; refill as necessary. * sinfo.ads: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 13 +++-- gcc/ada/sinf

[COMMITTED] ada: Refactor: replace uses of `not Present(X)` with `No (X)`

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Ghjuvan Lacambre `No (X)` is essentially `not Present (X)`, there's no reason for not using this shorter form. gcc/ada/ * checks.adb, exp_atag.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.adb, exp_disp.adb, exp_unst.adb, exp_util.adb, freeze.a

[COMMITTED] ada: Small editorial changes to documentation comments

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques gcc/ada/ * sinfo.ads: Small editorial changes. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sinfo.ads | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 53880c5dfce..abea84c

[COMMITTED] ada: Fix loop unnesting issue.

2022-11-04 Thread Marc Poulhiès via Gcc-patches
During loop unnesting, when the loop statements are wrapped in a code block, the newly created block's scope must be set to the loop scope (instead of the previous 'Current_Scope' that would point to an upper scope). gcc/ada/ * sem_util.ads (Add_Block_Identifier): Add new extra Scope

[COMMITTED] ada: Fix typo

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Fix typo in documentation. gcc/ada/ * doc/gnat_rm/standard_library_routines.rst: Fix typo. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/standard_library_routines.rst | 2 +- gcc/ada/gnat_rm.tex

[COMMITTED] ada: Skip dynamic interface conversion under configurable runtime

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Under configurable runtime, when the target type is an interface that is an ancestor of the operand type, skip generating code to displace the pointer to reference the target dispa

[COMMITTED] ada: Improve efficiency of scope stack restoration

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek We save/restore visibility by setting the Is_Immediately_Visible flag and appending entities to / removing them from the tail of an element list. However, the Is_Immediately_Visible flag can be restored in any order, while the element list is singly-linked and removal from t

[COMMITTED] ada: Remove redundant calls in handling of aspect specifications

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Routine Set_Aspect_Specifications sets the Has_Aspect flag, so there is no need to set this flag again afterwards. Code cleanup; semantics is unaffected. gcc/ada/ * aspects.adb (Relocate_Aspect): Remove call to Set_Has_Aspects. * sem_ch12.adb (Analyze_Forma

[COMMITTED] ada: Cleanup clearing flags on package variables

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When killing flags on assignable entities we iterated from First_Entity and then again from First_Private_Entity. This second iteration was unnecessary, because the entity chain that starts with First_Entity contains all entities, including the private ones. This is just a p

[COMMITTED] ada: Skip dynamic interface conversion under configurable runtime

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_disp.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_

[COMMITTED] ada: Fix various typos in GNAT RM

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek List of unknown words in files can be produced with: $ cat *.rst | ispell -l | tr '[:upper:]' '[:lower:]' | sort | uniq | less and can be easily filtered with eyes. gcc/ada/ * doc/gnat_rm/implementation_defined_aspects.rst: Fix typos. * doc/gnat_rm/i

[COMMITTED] ada: Static intrinsic functions are a core language extension.

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird GNAT-defined Ada extensions are divided into two categories: those that are enabled by either -gnatX or -gnatX0 and those which require -gnatX0. Move static intrinsic functions from the second category into the first. gcc/ada/ * doc/gnat_rm/implementation_defined_pragm

[COMMITTED] ada: Avoid repeated iteration over private protected components

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek The First_Entity/Next_Entity chain includes private entities, so there it no need to iterate starting both from First_Entity and First_Private_Entity. Code cleanup related to improved detection of references to uninitialized objects; behavior is unaffected. gcc/ada/

[COMMITTED] ada: Simplify detection of controlling formals

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When detecting controlling formals we are only interested in formal parameters and not in other entities. gcc/ada/ * sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal and not with First/Next_Entity. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Remove sa_messages

2022-11-04 Thread Marc Poulhiès via Gcc-patches
From: Ghjuvan Lacambre Spark and CodePeer do not depend on this unit anymore. gcc/ada/ * sa_messages.ads, sa_messages.adb: Remove files. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sa_messages.adb | 539 gcc/ada/sa_messages

<    2   3   4   5   6   7   8   9   >