[COMMITTED] ada: Fix copying of quantified expressions

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek While visiting the AST as part of routine New_Copy_Tree we maintain an EWA_Level variable in a stack-like fashion. This worked fine for expression with actions nodes but not for quantified expressions. gcc/ada/ * sem_util.adb (Visit_Node): Decrement EWA_Level with t

[COMMITTED] ada: Missing warning on null-excluding array aggregate component

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler does not report warnings on the initialization of arrays of null-excluding access type components by means of iterated component association, when the expression initializing each component is either a conditional expression or a case expression that may initiali

[COMMITTED] ada: Enable Support_Atomic_Primitives on VxWorks 7 PPC

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Johannes Kliemann gcc/ada/ * libgnat/system-vxworks7-ppc-kernel.ads: Enable Support_Atomic_Primitives. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads | 2

[COMMITTED] ada: Minor adjustments to Standard_Address

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Standard_Address is an internal entity that is meant to be a clone of System.Address built at compilation startup. It needs to be seen as a bona-fide address by the code generator. For the sake of completeness, it is also given its modulus, although this does not matter in p

[COMMITTED] ada: Require successful build of xsnamest

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Tom Tromey While experimenting, I introduced a compilation error into xsnamest. This took a little while to track down because, while the error was in the log, the build did not stop. This patch changes Make-generated.in to require a successful build of this program. gcc/ada/ * M

[COMMITTED] ada: Enhance Is_Null_Range and Not_Null_Range predicates

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Both predicates bail out if the bounds of the range are not known at compile time, whereas Compile_Time_Compare can deal with them in specific cases. gcc/ada/ * sem_eval.ads (Is_Null_Range): Remove requirements of compile-time known bounds and add WARNING lin

[COMMITTED] ada: Add missing guards in Selected_Range_Checks

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * checks.adb (Selected_Range_Checks): Add guards to protect calls to Expr_Value on bounds. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/checks.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/checks.adb b/gcc/ada

[COMMITTED] ada: Clean style in expansion of array aggregates

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup only; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Build_Array_Aggr_Code): Change variable to constant. (Check_Same_Aggr_Bounds): Fix style; remove unused initial value. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc

[COMMITTED] ada: Fix another couple of unchecked conversions to Ada.Tags.Tag

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou They are problematic on platforms where the provenance of pointers must be tracked throughout their lifetime. gcc/ada/ * exp_sel.adb: Add clauses for Sem_Util, remove them for Opt, Sinfo and Sinfo.Nodes. (Build_K): Always use 'Tag of the object.

[COMMITTED] ada: Refine types for an accessibility-checking routine

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup related to work on expression functions for GNATprove (which require accessibility checks even when they are not expanded and thus have no explicit return statements). gcc/ada/ * accessibility.adb (Is_Formal_Of_Current_Function): This routine ex

[COMMITTED] ada: Fix late extra formals creation

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Before this patch, in some situations, a subprogram call could be expanded before the extra formals for the subprogram were created. This patch fixes the problem in those situations. gcc/ada/ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Create extra formals

[COMMITTED] ada: Handle new Controlling_Tag format when converting to SCIL

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Ghjuvan Lacambre This commit fixes two CodePeer crashes that were introduced when the format of the controlling tag changed. gcc/ada/ * exp_disp.adb (Expand_Dispatching_Call): Handle new Controlling_Tag. * sem_scil.adb (Check_SCIL_Node): Treat N_Object_Renaming_Declaration

[COMMITTED] ada: Fix missing finalization in library-level instance body

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This extends the delaying mechanism present in the cases where the instance is not at library level, so as to wait until after the instantiation of the body is performed, before generating the finalizer of the compilation unit. gcc/ada/ * einfo.ads (Delay_Cleanups):

[COMMITTED] ada: Use computed value from os_constants to define sigset_t

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Doug Rupp Remove hard coded definition and conform to standard usage of using computed os_constants for opaque type declarations. gcc/ada/ * libgnarl/s-osinte__qnx.ads (sigset_t): Modify declaration to use system.os_constants computed value. Align it. Tested on x8

[COMMITTED] ada: Use context variables in expansion of aggregates

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Build_Constrained_Type): Remove local constants that were shadowing equivalent global constants; replace a wrapper that calls Make_Integer_Literal with a numeric literal; remove

[COMMITTED] ada: Remove Is_Descendant_Of_Address flag from Standard_Address

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou It breaks the Allow_Integer_Address special mode. Add new standard_address parameters to gigi and alphabetize others, this is necessary when addresses are not treated like integers. gcc/ada/ * back_end.adb (Call_Back_End): Add gigi_standard_address to the si

[COMMITTED] ada: Remove redundant guards from handling of record components

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Call to First on empty list is intentionally returning Empty. gcc/ada/ * sem_util.adb (Gather_Components): Remove guard for empty list of components. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 7 +-- 1 file changed,

[COMMITTED] ada: Simplify expansion of positional aggregates

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Build_Constrained_Type): Use List_Length to count expressions in consecutive subaggregates. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 12 +++- 1 f

[COMMITTED] ada: Remove redundant protection against empty lists

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Calls to Length on No_List intentionally return 0, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. gcc/ada/ * sem_ch13.adb (Check_Component_List): Local variable Compl is now a constant; a nested block is no longer

[COMMITTED] ada: Duplicate declaration of _master entity

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_ch9.adb (Build_Class_Wide_Master): Remember internal blocks that have a task master entity declaration. (Build_Master_Entity): Code cleanup. * sem_util.ads (Is_Internal_Block): New subprogram. * sem_util.adb (Is_Internal

[COMMITTED] ada: Crash on loop in dispatching conditional entry call

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_ch9.adb (Expand_N_Conditional_Entry_Call): Factorize code to avoid duplicating subtrees; required to avoid problems when the copied code has implicit labels. * sem_util.ads (New_Copy_Separate_List): Removed. (New

[COMMITTED] ada: Minor tweak in condition

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * sem_util.adb (Compile_Time_Constraint_Error): Test the Ekind. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb ind

[COMMITTED] ada: Reorder components in Ada.Containers.Restricted_Doubly_Linked_Lists

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou An instantiation of the package compiled with -gnatw.q yields: warning: in instantiation at a-crdlli.ads:317 [-gnatw.q] warning: record layout may cause performance issues [-gnatw.q] warning: in instantiation at a-crdlli.ads:317 [-gnatw.q] warning: component "No

[COMMITTED] ada: Simplify expansion of set membership

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch4.adb (Expand_Set_Membership): Simplify by using Evolve_Or_Else. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 17 +++-- 1 file changed, 7 insertions(+), 10 deleti

[COMMITTED] ada: Tune detection of expression functions within a declare expression

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_ch4.adb (Check_Action_OK): Replace low-level test with a high-level routine. * sem_ch13.adb (Is_Predicate_Static): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_

[COMMITTED] ada: Fix iteration over component items with pragmas

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Component items in a record declaration might include pragmas, which must be ignored when detecting components with default expressions. More a code cleanup than a bugfix, as it only affects artificial corner cases. Found while fixing missing legality checks for variant comp

[COMMITTED] ada: Cleanup expansion of membership operators into attribute Valid

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch4.adb (Is_OK_Object_Reference): Replace loop with a call to Unqual_Conv; consequently, change object from variable to constant; replace an IF statement with an AND THEN expression. Tested on x8

[COMMITTED] ada: Minor doc clarification

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Pattern Matching extension does not apply yet to case expressions. This is worth stating clearly, as this is a natural use of pattern matching to program in more functional style. gcc/ada/ * doc/gnat_rm/gnat_language_extensions.rst: Be more explicit on pattern

[COMMITTED] ada: Fix handling of Global contracts inside generic subprograms

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Routine Get_Argument works differently for generic units (as explained in its comment), but it failed to reliably detect such units when their kind is temporarily made non-generic (for resolving recursive calls, as explained in the comment at the end of Is_Generic_Declaration

[COMMITTED] ada: Cleanups in handling of aggregates

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Assorted cleanups related to recent fixes of aggregate handling for GNATprove; semantics is unaffected. gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate): Remove useless assignment. * sem_aux.adb (Has_Variant_Part): Remove useless guard; thi

[COMMITTED] ada: Fix internal error on Big_Integer conversion ghost instance

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The problem is that the ghost mode of the instance is used to analyze the parent of the generic body, whose own ghost mode has nothing to do with it. gcc/ada/ * sem_ch12.adb (Instantiate_Package_Body): Set the ghost mode to that of the instance only after loa

[COMMITTED] ada: Default initialize entity to avoid CodePeer message

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy CodePeer issues a false alarm when reading local entity Component later if not initialized by default. Fix this. gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate): Add dummy initialization and assertion that clarifies when we reassigned to a useful value. Tes

[COMMITTED] ada: Fix detection of non-static expressions in records with pragmas

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When iterating over record components we must ignore pragmas. Minor bug, as pragmas within record components do not appear often. gcc/ada/ * sem_cat.adb (Check_Non_Static_Default_Expr): Detect components inside loop, not in the loop condition itself. Tested

[COMMITTED] ada: Simplify iteration over record component items with possible pragmas

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_util.adb (Is_Null_Record_Definition): Use First_Non_Pragma and Next_Non_Pragma to ignore pragmas within component list. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 6

[COMMITTED] ada: Fix typos "statment" and "condtion"

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff ...caused by moving code here from Atree. gcc/ada/ * einfo.ads: Add comma. * contracts.adb: Fix typos. * exp_attr.adb: Likewise. * exp_ch5.adb: Likewise. * exp_ch6.adb: Likewise. * lib-xref.adb: Likewise. Tested on x86_64-pc-linux-

[COMMITTED] ada: Reject thin 'Unrestricted_Access value to aliased constrained array

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This rejects the Unrestricted_Access attribute applied to an aliased array with a constrained nominal subtype when its type is resolved to be a thin pointer. The reason is that supporting this case would require the aliased array to contain its bounds, and this is the case on

[COMMITTED] ada: Fix crash on 'Img as generic actual function

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff 'Image is allowed as an actual for a generic formal function. This patch fixes a crash when 'Img is used instead of 'Image in that context. Misc cleanups. gcc/ada/ * exp_put_image.adb (Build_Image_Call): Treat 'Img the same as 'Image. * exp_imgv.adb (Expa

[COMMITTED] ada: Corrections to premature-references rules

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch corrects the implementation of RM-8.3(17), which says that a record extension is self-hidden until "record". Previously, such premature references could cause a compiler crash. gcc/ada/ * sem_ch3.adb (Build_Derived_Record_Type): Temporarily set the stat

[COMMITTED] ada: Reorder components in Ada.Containers.Bounded_Doubly_Linked_Lists

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * libgnat/a-cbdlli.ads (List): Move Nodes component to the end. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-cbdlli.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/libgnat/a-cbdlli.ads b/gcc/ada/

[COMMITTED] ada: Remove leftover code for counting protected entries

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek We used to count protected entries by iterating over component declarations, but then switched to iterating over entities and left some code that is no longer needed. Cleanup; semantics is unaffected (maybe except fixing an assertion failure in developer builds when there is

[COMMITTED] ada: Fix double free on finalization of Vector in array aggregate

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The handling of finalization is delicate during the expansion of aggregates since the generated assignments must not cause the finalization of the RHS. That's why the No_Ctrl_Actions flag is set on them and the adjustments are generated manually. This was not done in the case

[COMMITTED] ada: Remove redundant guard against empty lists

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek There is no need to guard against routine Contains being called on No_Elist, because it will return False. Code cleanup related to handling of primitive operations in GNATprove; semantics is unaffected. gcc/ada/ * sem_prag.adb (Record_Possible_Body_Reference): Remov

[COMMITTED] ada: Complete contracts of SPARK units

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy SPARK units in the standard library (both Ada and GNAT ones) should have subprograms correctly annotated with contracts, so that a SPARK subprogram should always return (not fail or raise an exception) under the conditions expressed in its precondition, unless it is a procedure

[COMMITTED] ada: Crash on function returning allocated object containing tasks

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The frontend crashes when a function returns an object of a limited type that may have task components, has discriminants, and the object is created with an allocator. gcc/ada/ * exp_ch4.adb (Expand_N_Allocator): If an allocator with constraints is called

[COMMITTED] ada: Use truncation for dynamic conversions from floating point to fixed point

2023-05-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This changes the implementation of dynamic conversions from floating-point to ordinary fixed-point types, from rounding (to the nearest number) to truncation (toward zero), so as to make them consistent with both static conversions between these types and also the value of the

[COMMITED] ada: Tune comment of routine for detecting junk names

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Reword comment to avoid repetition between spec and body. gcc/ada/ * sem_warn.ads (Has_Junk_Name): Reword comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_warn.ads | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --

[COMMITED] ada: Remove definition of MAXPATHLEN for ancient MinGW

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Modern MinGW defines MAXPATHLEN in sys/param.h, so better to use it directly. gcc/ada/ * mingw32.h: Remove condition definition of MAXPATHLEN; the include directive for stdlib.h was most likely intended to provide the MAX_PATH. Tested on x86_64-pc-l

[COMMITED] ada: Deconstruct build support for ancient MinGW

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Remove conditional C code for building GNAT with MinGW earlier than 2.0, which was released in 2007. gcc/ada/ * adaint.c: Remove conditional #include directives for old MinGW. * cal.c: Always include winsock.h, since it is part of modern MinGW.

[COMMITED] ada: Improve accessibility check generation

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Justin Squirek Improve accessibility check generation by more precisely identifying cases in which an Original_Node call is needed. Instead of grabbing the Original_Node of a prefix in all cases (since this can cause issues where unanalyzed instance names get referenced) we only obtain the

[COMMITED] ada: Remove socket definitions for ancient MinGW

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Modern MinGW defines _WIN32_WINNT as 0xa00, so there is no need go guard against it being lower than 0x0600 or setting it to 0x0501. gcc/ada/ * gsocket.h: Remove redefinition of _WIN32_WINNT. * mingw32.h: Remove conditional definition of _WIN32_WINNT. Teste

[COMMITED] ada: Delay expansion of iterated component association

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification within an iterated component association should not be expanded, especially in GNATprove mode. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification):

[COMMITED] ada: Only reject volatile ghost objects when SPARK_Mode is On

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek SPARK rule that forbids ghost volatile objects is only affecting proof and not generation of object code. It is now only applied where SPARK_Mode is On. This flexibility is needed to compile code automatically instrumented by GNATcoverage. gcc/ada/ * contracts.adb (

[COMMITED] ada: Document support for the mold linker

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Kévin Le Gouguec gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Linker Switches): Document support for mold along with gold; add some advice regarding OpenSSL in the Pro version. * gnat_ugn.texi: Regenerate. --- ...building_executable_p

[COMMITED] ada: Document Long_Long_Long_Size parameter for -gnateT

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This was overlooked when the new parameter was created. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnateT): Document new parameter Long_Long_Long_Size. * gnat_ugn.texi: Regenerate. --- .../doc/gnat_ugn/building_executable_pr

[COMMITED] ada: Delay expansion of iterator specification in preanalysis

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification should not be expanded. This patch simplifies a complicated condition for delaying expansion within quantified expressions and iterated component associations.

[COMMITED] ada: Improve CUDA host-side and device-side binder support

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird Binder-generated code is not allowed to use Ada2012 syntax. In order to specify an aspect, a pragma must be used. gcc/ada/ * bindgen.adb: When the binder is invoked for the device, specify the CUDA_Global aspect for the adainit and adafinal procedures via

[COMMITED] ada: Make Original_Aspect_Pragma_Name more precise

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Tucker Taft This commit makes Original_Aspect_Pragma_Name more precise in cases where there is a second level of indirection caused by pragmas being turned into Check pragmas. gcc/ada/ * sem_util.adb (Original_Aspect_Pragma_Name): Check for Check pragmas. --- gcc/ada/sem_

[COMMITED] ada: Remove unreferenced Rtsfind entries

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Remove unreferenced entries for finding runtime units and runtime entities by the compiler. Code cleanup using basic grep scripting. gcc/ada/ * rtsfind.ads (RTU_Id): Remove unreferenced packages; fix whitespace. (RE_Id): Remove unreferenced entities;

[COMMITED] ada: Remove unreferenced C macro from OS constants template

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek The STR/STR1 macros in OS constants template has been unreferenced since 2005, so we can safely remove them. gcc/ada/ * s-oscons-tmplt.c (STR, STR1): Remove. --- gcc/ada/s-oscons-tmplt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/ada/s-oscons-tmplt.c

[COMMITED] ada: Doc: rename Valid_Image to Valid_Value

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Ghjuvan Lacambre This renaming happened some time ago in the code, but the documentation was not updated. gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Rename Valid_Image. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. --- .../implementat

[COMMITED] ada: Fix location of pragmas coming from aspects in top-level instances

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek This patch fixes an AST anomaly where pragmas that correspond to aspects of a generic package declaration appeared as the auxiliary declarations of the compilation unit for the instantiated package body. In particular, this anomaly happened for aspect Annotate and affected G

[COMMITED] ada: Remove GNATmetric's documentation from GNAT's documentation

2022-09-26 Thread Marc Poulhiès via Gcc-patches
From: Boris Yakobowski gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation for gnatmetric. --- .../doc/gnat_ugn/gnat_utility_programs.rst| 1120 + 1 file changed, 1 insertion(+), 1119 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/gnat_ut

[COMMITED] ada: Fix checking of Refined_State with nested package renamings

2022-09-29 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When collecting package state declared in package body, we should only recursively examine the visible part of nested packages while ignoring other entities related to packages (e.g. package bodies or package renamings). gcc/ada/ * sem_util.adb (Collect_Visible_Stat

[COMMITED] ada: Improve efficiency of slice-of-component assignment

2022-09-29 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch improves the efficiency of slice assignment when the left- or right-hand side is a slice of a component or a slice of a slice. Previously, the optimization was disabled in these cases, just in case there might be a volatile or independent component lurking. Now we explic

[COMMITED] ada: Further tweak new expansion of contracts

2022-09-29 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The original extended return statement is mandatory for functions whose result type is limited in Ada 2005 and later. gcc/ada/ * contracts.adb (Build_Subprogram_Contract_Wrapper): Put back the extended return statement if the result type is built-in-place.

[COMMITED] ada: Remove duplicated doc comment section

2022-09-29 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques A documentation section was duplicated by mistake in r0-110752. This commit removes the copy that was added by r0-110752, but integrates the small editorial change that it brought to the original. gcc/ada/ * einfo.ads: remove documentation duplicate Tested on x8

[COMMITED] ada: Fix spurious warning on unreferenced refinement constituents

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Listing an object as a state refinement constituent shouldn't be considered to be a reference, at least from the point of view of the machinery for detecting objects that are never referenced or written without being referenced. This patch fixes a spurious warning that rarel

[COMMITED] ada: Disable slice-of-component optimization in some cases

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch disables the Fast_Copy_Bitfield optimization in certain rare cases that currently do not work (crash in gigi). We could improve Expand_Assign_Array_Bitfield_Fast to handle these cases properly, but that change is delicate, so for now, we simply disable the optimization.

[COMMITED] ada: Do not issue compiler warnings in GNATprove mode

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Use of pragma Warning with a string literal to set warning switches, should not impact GNATprove which is not subject to these switches. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Ignore one variant of pragma Warnings in GNATprove mode. Tested on x86_64-pc-linu

[COMMITED] ada: Clean up slice-of-component optimization

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff In the recursive case of Volatile_Or_Independent = False for array types, fall through into later checks, so for example we check the type of the prefix of a slice. The pattern here is "return True in certain cases, otherwise fall through into the final 'return False'". Remove che

[COMMITED] ada: Accessibility error incorrectly flagged on call within Pre'Class expression

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Gary Dismukes The compiler was wrongly reporting an error on a function call within a Pre'Class expression when a formal of the aspect's subprogram was passed to an aliased formal. This occurred due to the call appearing with the return statement of the wrapper function created for the prec

[COMMITED] ada: Incorrect inferences drawn from if/elsif/while conditions with -gnatVo

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird Within the first (respectively, second) statement list of this if statement declare X : constant Integer := ... ; begin if X > 0 then ...; else ...; end if; end; we can safely assume that X is greater (respectively, not greater) than 0. F

[COMMITED] ada: Fix inserting of validity checks in lock-free protected subprograms

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Validity checks for statements in a lock-free implementation of protected subprogram were wrongly inserted in front of the original statements. This happened because the lock-free implementation was created as a shallow copy, where only the protected body statements were copi

[COMMITED] ada: Add C declarations for Storage Model support

2022-10-06 Thread Marc Poulhiès via Gcc-patches
Add needed C declarations for Storage Model support in gigi. gcc/ada/ * fe.h (Has_Storage_Model_Type_Aspect) (Has_Designated_Storage_Model_Aspect, Storage_Model_Object) (Storage_Model_Copy_From, Storage_Model_Copy_To): Add declarations. * sem_util.ads: Add

[COMMITED] ada: hardened booleans: exemplify codegen changes

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Alexandre Oliva Show the sort of code that is to be expected from using hardened booleans in Ada code. Mention that C traps instead of raising exceptions. gcc/ada/ * doc/gnat_rm/security_hardening_features.rst: Add examples of codegen changes in hardened booleans. Mention

[COMMITED] ada: hardened conditionals: exemplify codegen changes

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Alexandre Oliva gcc/ada/ * doc/gnat_rm/security_hardening_features.rst: Add examples of codegen changes in hardened conditionals. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_rm/security_hardening_features.rst | 5

[COMMITED] ada: Cleanup related to lock-free protected subprograms

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Cleanup code and documentation; semantics is unaffected. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Lock_Free): Remove inconsistent periods that end item descriptions. * sem_ch9.adb (Allows_Lock_Free_Implementation): R

[COMMITED] ada: stack scrubbing: exemplify codegen changes

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Alexandre Oliva gcc/ada/ * doc/gnat_rm/security_hardening_features.rst: Add examples of codegen changes in stack scrubbing. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_rm/security_hardening_features.rst | 52

[COMMITED] ada: Reject conditional goto in lock-free protected subprograms

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek In lock-free protected subprograms we don't allow goto statements; likewise, we now reject conditional goto statements. This fix only affects semantic checking mode with switch -gnatc. In ordinary compilation we already rejected conditional goto after it was expanded into or

[COMMITED] ada: Minor potential bug in sem_ch6.adb

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird In sem_ch6.adb, the procedure Analyze_Procedure_Call is preceded with a comment: -- WARNING: This routine manages Ghost regions. Return statements must be -- replaced by gotos that jump to the end of the routine and restore the -- Ghost mode. Correct a violation of

[COMMITED] ada: Implementation of support for storage models in gigi

2022-10-06 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou It is based on a new LOAD_EXPR node in GENERIC that is later turned into a bona-fide temporary during gimplification. gcc/ada/ * gcc-interface/ada-tree.def (LOAD_EXPR): New expression code. * gcc-interface/gigi.h (build_storage_model_load): Declare. (

[PATCH] testsuite: fixup pr97521.c and pr96713.c on i686-*

2022-03-17 Thread Marc Poulhiès via Gcc-patches
On targets that do not have MXX/SSE enabled by default, pr97521 and pr96713 fail because they emit warnings: pr97521.c:12:1: warning: MMX vector return without MMX enabled changes the ABI [-Wpsabi] pr97521.c:11:1: note: the ABI for passing parameters with 16-byte al

Re: [PATCH v2] x86: Also check _SOFT_FLOAT in

2022-03-17 Thread Marc Poulhiès via Gcc-patches
"H.J. Lu" writes: Hello, > I am checking it in. Are you planning on also applying this patch in the gcc-11 branch? Thanks, Marc

Re: [PATCH] testsuite: fixup pr97521.c and pr96713.c on i686-*

2022-03-28 Thread Marc Poulhiès via Gcc-patches
Marc Poulhiès writes: > On targets that do not have MXX/SSE enabled by default, pr97521 > and pr96713 fail because they emit warnings: > > pr97521.c:12:1: warning: MMX vector return without MMX enabled > changes the ABI [-Wpsabi] > pr97521.c:11:1: note: the ABI for passing paramet

Re: [PATCH] testsuite: Check fpic support in pr103275.c

2022-03-28 Thread Marc Poulhiès via Gcc-patches
Marc Poulhiès writes: > Test must check for effective support of fpic. > > Tested on x86_64-pc-linux-gnu{-m32,}. > > ok for master? ping?

[PATCH] testsuite: add missing dg-require-effective-target fpic

2022-03-31 Thread Marc Poulhiès via Gcc-patches
Require effective target fpic for newly added test. gcc/testsuite/ * g++.dg/ext/visibility/visibility-local-extern1.C: Add missing dg-require-effective-target fpic. Tested on x86_64-linux. Ok for master? --- gcc/testsuite/g++.dg/ext/visibility/visibility-local-extern1.C | 1 + 1

[PATCH] testsuite: Check fpic support in pr103275.c

2022-02-28 Thread Marc Poulhiès via Gcc-patches
Test must check for effective support of fpic. Tested on x86_64-pc-linux-gnu{-m32,}. ok for master? gcc/testsuite/ChangeLog: * gcc/gcc.target/i386/pr103275.c: Add missing dg-require-effective-target for checking fpic. --- gcc/testsuite/gcc.target/i386/pr103275.c | 1 + 1 file

[Ada] Fix proof of runtime unit System.Value* and System.Image*

2022-09-02 Thread Marc Poulhiès via Gcc-patches
Refactor specification of the Value* and Image* units and fix proofs. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-nbnbig.ads: Add Always_Return annotation. * libgnat/s-vaispe.ads: New ghost unit for the specification of System.Value_I. Restore p

[Ada] Update documentation about non-symbolic traceback

2022-09-02 Thread Marc Poulhiès via Gcc-patches
This documents the limitation of addr2line with Position-Independent Code, introduces the replacement tool gnatsymbolize and adjusts obsolete stuff. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst (Non-Symbolic Traceback):

[Ada] Error on return of object whose full view has undefaulted discriminants

2022-09-02 Thread Marc Poulhiès via Gcc-patches
The compiler wrongly reports an error about the expected type not matching the same-named found type in a return statement for a function whose result type has unknown discriminants when the full type is tagged and has an undefaulted discriminant, and the return expression is an object initialized

[Ada] Fix proof of runtime unit System.Wid_*

2022-09-02 Thread Marc Poulhiès via Gcc-patches
Regain the proof of System.Wid_* after changes in provers and Why3. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-widthu.adb (Lemma_Euclidean): Lemma to prove the relation between the quotient/remainder of a division.diff --git a/gcc/ada/libgnat/s-widthu.

[Ada] Fix proof of runtime unit System.Exp_Mod

2022-09-02 Thread Marc Poulhiès via Gcc-patches
Regain the proof of System.Exp_Mod after changes in provers and Why3. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-expmod.adb (Lemma_Add_Mod): Add new lemma to factor out a complex sub-proof. (Exp_Modular): Add assertion to help proof.diff --git

[Ada] Recover proof of Scaled_Divide in System.Arith_64

2022-09-02 Thread Marc Poulhiès via Gcc-patches
Proof of Scaled_Divide was impacted by changes in provers and Why3. Recover it partially, leaving some unproved basic inferences to be further investigated. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb: Add or rework ghost code. * libgnat/s-ar

[Ada] Add loop variants to Ada.Strings.Search and Ada.Strings.Maps

2022-09-02 Thread Marc Poulhiès via Gcc-patches
Add loop variants to verify that loops terminate in string handling. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-strmap.adb: Add variants to simple and while loops. * libgnat/a-strsea.adb: Idem.diff --git a/gcc/ada/libgnat/a-strmap.adb b/gcc/ada/libgnat

[Ada] Fix crash on declaration of overaligned array with constraints

2022-09-02 Thread Marc Poulhiès via Gcc-patches
The semantic analyzer was setting the Is_Constr_Subt_For_UN_Aliased flag on the actual subtype of the object, which is incorrect because the nominal subtype is constrained. This also adjusts a recent related change. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.a

[Ada] Adjust previous change to Expand_Subtype_From_Expr

2022-09-02 Thread Marc Poulhiès via Gcc-patches
An aggregate may have been rewritten before being seen by the procedure. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Expand_Subtype_From_Expr): Be prepared for rewritten aggregates as expressions.diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.

[Ada] Improve pretty-printing of iterated component associations

2022-09-05 Thread Marc Poulhiès via Gcc-patches
Pretty-printing used mostly in the debugger now handles more Ada 2022 syntax features. In particular, now it correctly handles expressions like "[for E of A when E /= X => E]". Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sprint.adb (Sprint_Node_Actual): Handle iterator_s

[Ada] Fix syntax in documentation

2022-09-05 Thread Marc Poulhiès via Gcc-patches
Leading to a poorly formatted example section. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst: Fix rest syntax * gnat_ugn.texi: Regenerate.diff --git a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst b/gcc/ada/doc/gnat

[Ada] Cleanup expansion of attribute Priority

2022-09-05 Thread Marc Poulhiès via Gcc-patches
Semantically neutral cleanup after the main fix for expansion of attribute Priority. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo-utils.adb (Number_Entries): Refine type of a local variable. * exp_attr.adb (Expand_N_Attribute_Reference): Rename Conctyp to

[Ada] Fix crash for Default_Initial_Condition on derived enumeration type

2022-09-05 Thread Marc Poulhiès via Gcc-patches
This fixes a crash on the declaration of a private derived enumeration type with the Default_Initial_Condition aspect and in the process makes a couple of related adjustments: 1) removes the early freezing of implicit character and numeric base types and 2) fixes an oversight in the implementation

<    1   2   3   4   5   6   7   8   9   >