Re: [PATCH, PING] DWARF: space-optimize loc. descr. for integer literals on 32-bit targets

2016-10-12 Thread Pierre-Marie de Rodat
On 10/12/2016 10:13 AM, Richard Biener wrote: Ok. Thanks, Committed. Thank you! -- Pierre-Marie de Rodat

[PATCH] DWARF: make signedness explicit for enumerator const values

2016-10-13 Thread Pierre-Marie de Rodat
Hello, Currently, the DWARF description does not specify the signedness of the representation of enumeration types. This is a problem in some contexts where DWARF consumers need to determine if value X is greater than value Y. For instance in Ada: type Enum_Type is ( A, B, C, D); for En

Re: [PATCH] DW_TAG_ptr_to_member_type for PMF and DW_AT_{,rvalue_}reference for those

2016-11-03 Thread Pierre-Marie de Rodat
. I couldn't find any unfortunately. Pierre, could you please test if the following patch doesn't regress anything in the Ada debug info area? Yes, DWARF output is hard to test… or at least I haven’t find a way to do so in TCL/DejaGNU. ;-) I have my own Python-based testsuite, w

[PATCH] [PR78112] Remove the g++.dg/pr78112.C testcase

2016-11-30 Thread Pierre-Marie de Rodat
Hello, I recently added a testcase for PR78112's resolution. Unfortunately, what it tests changes from one platform to another and I even get different results for a single platform (see ). As multiple developpers reported these errors and as

Re: [PATCH] [PR78112] Remove the g++.dg/pr78112.C testcase

2016-12-08 Thread Pierre-Marie de Rodat
x and x86_64-apple-darwin-16.3.0 and I’ve checked manually we have the correct number of attributes with a partial arm-none-abi compiler (i.e. just cc1plus). -- Pierre-Marie de Rodat >From fa8d7ca05a8711e261b5c4cfeec885c3ecede508 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: We

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Pierre-Marie de Rodat
On 11/18/2016 06:22 PM, Pierre-Marie de Rodat wrote: I agree with you, so I’ll revise to instead add a DW_AT_type attribute to enumeration DIEs to point to a base type. Here is the patch to implement this. Bootstrapped and regtested (GCC’s testsuite) successfuly on x86_64-linux. However, it

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-12-09 Thread Pierre-Marie de Rodat
ll options, it’s just that I’m not confident enough that it will be fine for DWARF consumers. -- Pierre-Marie de Rodat

Re: [PATCH] DWARF: turn dw_loc_descr_node field into hash map for frame offset check

2016-04-27 Thread Pierre-Marie de Rodat
On 04/27/2016 01:31 PM, Richard Biener wrote: Ok. Thanks, Richard. Thank you for the very quick feedback! I just commited the change. -- Pierre-Marie de Rodat

[PATCH] Fix a typo in dwarf2out.c:resolve_args_picking_1

2016-05-03 Thread Pierre-Marie de Rodat
Hello, Under specific circumstances for Ada programs, such as in the testcase this change adds, the DWARF back-end currently crashes because of inconsistent internal state. This is due to a typo: a local variable is called frame_offset_ but resolve_args_picking_1 wrongly modifies emit-rtl.h's fram

Re: [PATCH] Fix a typo in dwarf2out.c:resolve_args_picking_1

2016-05-03 Thread Pierre-Marie de Rodat
On 05/03/2016 05:41 PM, Richard Biener wrote: This change fixes this typo. Bootstrapped and regtested on x86_64-linux successfuly. Ok to commit? Thank you in advance! OK also for branches. Comitted to trunk and gcc-6-branch. Thank you! -- Pierre-Marie de Rodat

[PING*2][PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-05-04 Thread Pierre-Marie de Rodat
Ping for the patch submitted at <https://gcc.gnu.org/ml/gcc-patches/2016-01/msg01495.html>. It applies just fine on the current trunk and still bootstrapps and regtests successfuly on x86_64-linux. Thank you in advance, -- Pierre-Marie de Rodat

Re: [PING*2][PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-05-10 Thread Pierre-Marie de Rodat
On 05/09/2016 01:01 PM, Richard Biener wrote: Ok and sorry for the delay. No problem. :-) Thanks, this is committed! -- Pierre-Marie de Rodat

[PATCH] DWARF: fix stack usage assessment for DW_OP_neg

2016-05-10 Thread Pierre-Marie de Rodat
Hello, When the DWARF back-end generates DW_OP_neg operations in DWARF procedures, we get an ICE because of inconsistent stack usage computation for the embedding expression. This is because resolve_args_picking_1 thinks DW_OP_neg is a binary operation (pops 2 stack slots, pushes 1) whereas it rea

Re: [PATCH] DWARF: fix stack usage assessment for DW_OP_neg

2016-05-10 Thread Pierre-Marie de Rodat
On 05/10/2016 05:20 PM, Jakub Jelinek wrote: gcc/ * dwarf2out.c (resolve_args_picking_1): Consider DW_OP_neg as an unary operation, not a binary one. Ok. This is committed. Thank you Jakub for the quick feedback! -- Pierre-Marie de Rodat

[PATCH, PING*2] PR rtl-optimization/66790: uninitialized registers handling in REE

2015-08-08 Thread Pierre-Marie de Rodat
On 07/19/2015 12:14 AM, Pierre-Marie de Rodat wrote: This patch is an attempt to fix PR rtl-optimization/66790: please see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790> for the context. This adds a new dataflow problem (MIR for Must-Initialized Registers) and use it in the REE p

[PATCHES, PING*3] Enhance standard DWARF for Ada

2015-08-08 Thread Pierre-Marie de Rodat
Hi, On 07/16/2015 10:34 AM, Pierre-Marie de Rodat wrote: This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, variable-length records, variant parts, etc. Ping for

[PATCH, PING*2] DWARF: materialize subprogram renamings in Ada as imported declarations

2015-08-08 Thread Pierre-Marie de Rodat
On 07/25/2015 09:44 PM, Pierre-Marie de Rodat wrote: This change makes GCC materialize subprogram renamings in Ada as imported declarations (DW_TAG_imported_declarations). For instance, procedure Foo renames Bar; will output: DW_TAG_imported_declaration: DW_AT_name: foo

[PATCH, PING*3] PR debug/53927: fix value for DW_AT_static_link

2015-08-08 Thread Pierre-Marie de Rodat
On 07/20/2015 09:39 AM, Pierre-Marie de Rodat wrote: This patch fixes the static link description in DWARF to comply with the specification. In order to do so, it appends a field to all FRAME objects to hold the frame base address (DW_AT_frame_base) so that the nested subrograms can directly

[PATCH, PING*3] Track indirect calls for call site information in debug info.

2015-08-08 Thread Pierre-Marie de Rodat
On 07/20/2015 02:45 PM, Pierre-Marie de Rodat wrote: On PowerPC targets with -mlongcall, most subprogram calls are turned into indirect calls: the call target is read from a register even though it is compile-time known. This makes it difficult for machine code static analysis engines to recover

Re: [PATCH] Add extensions to dwarf2.def

2015-08-14 Thread Pierre-Marie de Rodat
ion=edit>, I'm logged in as pmderodat). Does anyone know how I should proceed? -- Pierre-Marie de Rodat >From 5b18866caaa8206788baf086c02a7aaf91d555a6 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Tue, 9 Jun 2015 10:31:50 +0200 Subject: [PATCH 1/2] DWARF2: add extensio

Re: [PATCH 7/8] DWARF: add a language hook for scalar biased types

2015-08-18 Thread Pierre-Marie de Rodat
On 07/16/2015 10:48 AM, Pierre-Marie de Rodat wrote: Front-ends like GNAT for Ada sometimes use biased encodings for integral types. This change creates a new language hook so that the bias information can make it into the debugging information back-end and introduces an experimental DWARF

Re: [PATCH 4/8] DWARF: add a language hook for fixed-point types

2015-08-18 Thread Pierre-Marie de Rodat
On 07/16/2015 10:43 AM, Pierre-Marie de Rodat wrote: Support for fixed-point types in GCC is not powerful enough for Ada fixed-point types: GNAT uses regular scalar types to implement them. This new language hook makes it possible to output the desired debugging information anyway. Here'

Re: [PATCH] Add extensions to dwarf2.def

2015-08-18 Thread Pierre-Marie de Rodat
On 08/18/2015 11:36 AM, Manuel López-Ibáñez wrote: On 18/08/15 10:32, Pedro Alves wrote: On 08/14/2015 10:49 AM, Pierre-Marie de Rodat wrote: I also tried to create the new pages on the wiki but it says "You are not allowed to edit this page." (<https://gcc

Re: [PATCH] Add extensions to dwarf2.def

2015-08-18 Thread Pierre-Marie de Rodat
at to copy this text in GCC's: may I do this? -- Pierre-Marie de Rodat

Re: [PATCH] Add extensions to dwarf2.def

2015-08-18 Thread Pierre-Marie de Rodat
his change. ;-) Thank you! I will "just do it" next time. -- Pierre-Marie de Rodat

[PATCH, PING*3] PR rtl-optimization/66790: uninitialized registers handling in REE

2015-08-31 Thread Pierre-Marie de Rodat
On 07/19/2015 12:14 AM, Pierre-Marie de Rodat wrote: This patch is an attempt to fix PR rtl-optimization/66790: please see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790> for the context. This adds a new dataflow problem (MIR for Must-Initialized Registers) and use it in the REE p

[PATCH, PING*3] DWARF: materialize subprogram renamings in Ada as imported declarations

2015-08-31 Thread Pierre-Marie de Rodat
On 07/25/2015 09:44 PM, Pierre-Marie de Rodat wrote: This change makes GCC materialize subprogram renamings in Ada as imported declarations (DW_TAG_imported_declarations). For instance, procedure Foo renames Bar; will output: DW_TAG_imported_declaration: DW_AT_name: foo

[PATCH, PING*4] PR debug/53927: fix value for DW_AT_static_link

2015-08-31 Thread Pierre-Marie de Rodat
On 07/20/2015 09:39 AM, Pierre-Marie de Rodat wrote: This patch fixes the static link description in DWARF to comply with the specification. In order to do so, it appends a field to all FRAME objects to hold the frame base address (DW_AT_frame_base) so that the nested subrograms can directly

[PATCH, PING*4] Track indirect calls for call site information in debug info.

2015-08-31 Thread Pierre-Marie de Rodat
On 07/20/2015 02:45 PM, Pierre-Marie de Rodat wrote: On PowerPC targets with -mlongcall, most subprogram calls are turned into indirect calls: the call target is read from a register even though it is compile-time known. This makes it difficult for machine code static analysis engines to recover

[PATCHES, PING*4] Enhance standard DWARF for Ada

2015-08-31 Thread Pierre-Marie de Rodat
On 07/16/2015 10:34 AM, Pierre-Marie de Rodat wrote: This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, variable-length records, variant parts, etc. Ping for the pa

[PATCH] debug/PR78112: remove recent duplicates for DW_TAG_subprogram attributes

2016-11-08 Thread Pierre-Marie de Rodat
Hello, This patch comes from the discussion for PR debug/78112 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78112). It seems to fix the regression Rainer detected on x86_64-apple-darwin, although I still wonder why remaining duplicate attributes (which were already present before my original pat

[PING, PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-08 Thread Pierre-Marie de Rodat
Hello, Ping for the patch submitted there: <https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01060.html>. Thank you in advance! -- Pierre-Marie de Rodat

Re: [PATCH] debug/PR78112: remove recent duplicates for DW_TAG_subprogram attributes

2016-11-10 Thread Pierre-Marie de Rodat
? Ok. This is committed as r242035. Thanks! -- Pierre-Marie de Rodat

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-14 Thread Pierre-Marie de Rodat
agree it would make sense, but would it be acceptable to enable this even in strict mode? If not, I’d prefer to stick to a solution that would apply everywhere. :-) -- Pierre-Marie de Rodat

Re: [PATCH] DWARF: make signedness explicit for enumerator const values

2016-11-18 Thread Pierre-Marie de Rodat
sumer looses without an actual (base) type telling them how to interpret the constant. I see, thank you for the explanation! :-) I agree with you, so I’ll revise to instead add a DW_AT_type attribute to enumeration DIEs to point to a base type. -- Pierre-Marie de Rodat

Re: [PATCH] debug/PR78112: remove recent duplicates for DW_TAG_subprogram attributes

2016-11-18 Thread Pierre-Marie de Rodat
/show_bug.cgi?id=78112#c17), I reproduce inconsistent results on this even on a very reduced testcase. So I wonder if I should just remove this testcase. -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2015-12-16 Thread Pierre-Marie de Rodat
On 12/11/2015 09:25 PM, Jason Merrill wrote: Hmm, can we generate the DWARF procedures during finalize_size_functions to avoid the need for preserve_body? Good idea, thank you! Here’s the updated patch (bootstrapped and regtested on x86_64-linux, as usual). -- Pierre-Marie de Rodat >F

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2015-12-17 Thread Pierre-Marie de Rodat
On 12/16/2015 10:30 PM, Jason Merrill wrote: OK with those changes. All changes done, and all patches pushed. Thank you very much!! -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2015-12-18 Thread Pierre-Marie de Rodat
, thank you for the heads up. -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2015-12-21 Thread Pierre-Marie de Rodat
On 12/18/2015 09:23 PM, Pierre-Marie de Rodat wrote: On 12/18/2015 06:56 PM, Jason Merrill wrote: These broke a lot of tests in the GDB C++ testsuite. Specifically, the commit DWARF: handle variable-length records and variant parts Arg, sad to hear that! I did testing at some point

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2015-12-21 Thread Pierre-Marie de Rodat
On 12/21/2015 04:39 PM, Jason Merrill wrote: OK, thanks. Committed. Thank you again! -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2016-01-05 Thread Pierre-Marie de Rodat
On 01/03/2016 12:45 AM, Eric Botcazou wrote: On powerpc64: FAIL: gnat.dg/specs/debug1.ads scan-assembler-times DW_AT_artificial 18 $ grep -c DW_AT_artificial debug1.s 17 Test removed. Thank you both! -- Pierre-Marie de Rodat

[PATCH 1/2] DWARF: process all TYPE_DECL nodes when iterating on scopes

2016-01-05 Thread Pierre-Marie de Rodat
Hello, In Ada, it is possible to have nested subprograms in the following configuration: procedure Parent is type T; [...] procedure Child (Value : T) is begin [...] end Child; begin [...] end Parent; If we generate debugging infor

[PATCH 2/2] Ada: add XVE/XVU parallel types to lexical scopes

2016-01-05 Thread Pierre-Marie de Rodat
Hello, This change adds TYPE_DECL nodes for XVE/XVU parallel types to lexical scopes so that these types are properly scoped in the debug information. Ok to commit? Thank you in advance! gcc/ada/ChangeLog: * gcc-interface/utils.c (rest_of_record_type_compilation): Add XVE/XVU pa

Re: [PATCH 2/2] Ada: add XVE/XVU parallel types to lexical scopes

2016-01-06 Thread Pierre-Marie de Rodat
Committed. Thank you! -- Pierre-Marie de Rodat

[PATCH, PING] DWARF: process all TYPE_DECL nodes when iterating on scopes

2016-01-12 Thread Pierre-Marie de Rodat
Hello, Ping for the patch submitted in <https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00160.html>. Thanks! -- Pierre-Marie de Rodat

[PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-01-12 Thread Pierre-Marie de Rodat
Hello, Although the following patch does not fix a regression, I believe it fixes a bug visible from a debugger, so I think it’s a valid candidate at this stage. This change tracks from which abstract lexical block concrete ones come from in DWARF so that debuggers can inherit the former fro

Re: [PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-01-15 Thread Pierre-Marie de Rodat
Anyway, the patch looks ok to me but please give others a chance to chime in. Sure. Thank you for reviewing! -- Pierre-Marie de Rodat /* { dg-do run } */ /* { dg-options "-O2 -g -std=gnu99" } */ extern void *create (const char *); extern void destroy (void *); extern void do_nothing (c

Re: [PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-01-18 Thread Pierre-Marie de Rodat
will not be too fragile… -- Pierre-Marie de Rodat

Re: [PATCH 1/2] DWARF: process all TYPE_DECL nodes when iterating on scopes

2016-01-19 Thread Pierre-Marie de Rodat
does to modified_type just returns the existing DW_TAG_record_type (still in the global scope). So assuming your proposal of the change is correct, should we then use TYPE_CONTEXT in order to (potentially) relocate TREE_TYPE (decl) in add_type_attribute? -- Pierre-Marie de Rodat -- The aim o

[PING] Enhance array types debug info. for Ada

2014-12-15 Thread Pierre-Marie de Rodat
Ping for https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00058.html. On 12/01/2014 05:40 PM, Pierre-Marie de Rodat wrote: While I agree this might trigger compatibility issues with old debuggers, I don't know what to do assuming this change is not acceptable: should we add a klud

Re: [PING] Enhance array types debug info. for Ada

2014-12-17 Thread Pierre-Marie de Rodat
On 12/15/2014 05:24 PM, Jakub Jelinek wrote: Ok for trunk then. All the 5 commits are submitted. Thank you very much for your review! :-) -- Pierre-Marie de Rodat

[PING] Enhance array types debug info. for Ada

2014-09-17 Thread Pierre-Marie de Rodat
Ping for https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00206.html Adding a few maintainers in copy... Thanks in advance! -- Pierre-Marie de Rodat

[PING 2] Enhance array types debug info. for Ada

2014-10-03 Thread Pierre-Marie de Rodat
On 09/17/2014 04:38 PM, Pierre-Marie de Rodat wrote: Ping for https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00206.html Adding a few maintainers in copy... Thanks in advance! Should I enhance something in this patch set in order to make the review easier? Thanks! -- Pierre-Marie de Rodat

[Ada] Plug loophole for built-in-place return with limited_with clause

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When the result type of a function requiring built-in-place return is only visible through a limited_with clause, the compiled needs to wait for the nonlimited view to be available in order to compute whether the built-in-place return is needed, and this comprises tagging the function with the Retu

[Ada] Incorrect accessibility check on return of discriminated type

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an error in the compiler whereby the presence of a call to a function returning a type with an access discriminant within an expanded loop condition caused the wrong value to be supplied for the extra- accessibility-of-result actual, thus causing incorrect checks within the call

[Ada] Adjust description of Pure_Function pragma

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The current wording can be read as implying that the result of a call to a pure function does not depend on the context, which is incorrect. The pragma only guarantees the absence of side effects of such a call. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/imp

[Ada] Fix for resolution of overloaded subprogram for Iterable aspect

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When resolving the Iterable aspect we look for a functions that are declared in the same scope as the annotated type and that have the required number and types formal parameters. However, we didn't guard against functions that have no formal parameter at all. Tested on x86_64-pc-linux-gnu, commit

[Ada] Update the documentation of functional containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Functional containers are now controlled. Update the documentation accordingly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/the_gnat_library.rst: Functional vectors, sets, and maps are now controlled. * gnat_rm.texi: Regenerate.diff --git a/gc

[Ada] Create new unbounded functional sequence

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Add a new unbounded functional sequence. This sequence is indexed by Big_Positive and so is unbounded from the user and spark points view. Hower the actually implemented sequence are bounded by Count_Type'Last. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cfinse

[Ada] Tech debt: Remove code duplication

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects removes some code duplication within the GNAT compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Remove_Side_Effects): Combine identical branches. * sem_attr.adb (Analyze_Attribute): Combine identical cases Att

[Ada] Compiler rejects legal allocator in record component constraint expression

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
In some cases when a legal allocator which defines a new subtype for the allocated object occurs as part of a record component constraint expression, the compiler would incorrectly reject the allocator. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Analyze_All

[Ada] Add Ada 2022 features to sets containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds some Ada 2022 features to the set children of Ada.Containers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbhase.adb, libgnat/a-cbhase.ads, libgnat/a-cborse.adb, libgnat/a-cborse.ads, libgnat/a-cihase.adb, libgnat/a-cihase.ads,

[Ada] Assertions in Einfo.Utils

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Add predicates on subtypes E and N. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo-utils.ads, einfo-utils.adb: Add predicates on subtypes E and N. Change some parameters to use the unpredicated subtypes, because they sometimes return e.g. Empty. Note

[Ada] Add GNAT specific pragmas to the equivalent Assertion_Policy for -gnata

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
All assertion pragmas are enabled by default when using -gnata. We need to add the GNAT specific ones to the list. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging and Assertion Control): Add GNAT spec

[Ada] Single character argument in call to Quote_Argument raises error

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an issue in the compiler whereby calling Quote_Argument with an argument that is of size 1 may lead to a CONSTRAINT_ERROR raised at runtime due to an undersized buffer. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-os_lib.adb (Quote_Argument):

[Ada] Do not use front-end build-in-place mechanism for nonlimited types

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
It was only used in specific cases for controlled types but no longer provides any significant benefit in practice. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d.9): Remove usage. * exp_ch6.adb (Expand_Simple_Function_Return): Remove redundant

[Ada] Give missing error on ambiguous operand of equality operator

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When the code responsible for giving errors on ambiguous operands of comparison and equality operators was moved from the 1st phase (analysis) to the 2nd phase (resolution) of semantic processing, it was incorrectly restricted to the operator case, which was valid during the 1st phase but is not du

[Ada] Refactor duplicated resolution of Count and Index attributes

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Attribute Index, which was added to Ada 2022 by AI12-0143, is resolved just like attribute Count. However, code duplication rightly triggered a CodePeer warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Resolve_Attribute): Refactor duplicated code for

[Ada] Use static stack allocation for small dynamic string concatenations

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the expanded code generated for dynamic concatenations to use a static array subtype for the temporary created on the stack if a small upper bound can be computed for the length of the result. Static stack allocation is preferred over dynamic allocation for code generation purposes.

[Ada] Add a RM entry for the functional infinite sequences

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Modify the RM to take into account the new functional container. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/the_gnat_library.rst: Add the new entry. * gnat_rm.texi: Regenerate. patch.diff.gz Description: application/gzip

[Ada] Fix dispatching call to primitive function with controlling tagged result

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When a dispatching call is made to a primitive function with a controlling tagged result, the call is dispatching on result and thus must return the class-wide type of the tagged type to accommodate all possible results. This was ensured by Expand_Dispatching_Call only in the common case where the

[Ada] Small housekeeping work in Expand_N_Object_Declaration

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The local function Rewrite_As_Renaming can be called twice in certain circumstances, which is both not quite safe and unnecessary, so this replaces it with a local variable whose value is computed only once. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Avoid unwanted warnings for statically-known-successful assertions

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The -gnatwc switch enables warnings for test condition outcomes that are known at compile time. Such warnings are unlikely to be useful in the case of an assertion expression (or a subexpression thereof), so do not generate them in that case. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/

[Ada] vx7r2: do not include s-qnx.ads in the kernel and rtp runtimes

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Target specific runtime files must be added to a the exclude list so the files don't automatically get copied to other runtimes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (ADA_EXCLUDE_SRCS): Add s-qnx.ads.diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefil

[Ada] Add Ada 2022 Key function to sets containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds the new Generic_Keys.Key function to the set children of Ada.Containers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbhase.ads, libgnat/a-cborse.ads, libgnat/a-cihase.ads, libgnat/a-ciorse.ads, libgnat/a-cohase.ads, libgnat/a-co

[Ada] Do not make procedure call with only tag-indeternminate actuals dispatching

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The RM 3.9.2(19) clause says that the controlling tag value is statically determined to be the tag of the tagged type involved. As a matter of fact, the call would be made dispatching only as a by-product of the propagation of the controlling tag value to the tag-indeternminate actuals, but that's

[Ada] Call-initialize all controlled objects in place

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the compiler to build in place almost all objects that need finalization and are initialized with the result of a function call, thus saving a pair of Adjust/Finalize calls for the anonymous return object. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.

[Ada] Fix missing error on 'Access of constrained array

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
For X'Access, the designated subtype of the access type must statically match the nominal subtype of X. This patch fixes a bug where the error was not detected when there is an unrelated declaration of the form "Y : T := X;", where T is an unconstrained array subtype. Tested on x86_64-pc-linux-gn

[Ada] Enforce deferred constant completion rules

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
If a constrained subtype is given when a deferred constant is declared, then the subtype given in the completion is required (at compile time) to be subject to a statically matching constraint. This rule was not properly enforced in some cases and constructs that should have been rejected were inco

[Ada] Use static stack allocation for small string if-expressions

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the expanded code generated for if-expressions of 1-dimensional arrays to create a static temporary on the stack if a small upper bound can be computed for the length of a subtype covering the result. Static stack allocation is preferred over dynamic allocation for code generation pur

[Ada] Remove old vxworks6 from Makefile.rtl

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Pre vxworks7 code excepting legacy vxworks6 code is removed from Makefile.rtl and unused files are deleted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (*vxworks*): Remove most pre-vxworks7 code. * vxworks-arm-link.spec: Remove. * vxworks-e50

[Ada] Remove unimplemented convert_addresses declaration

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
convert_addresses is declared in adaint.h but is never referenced, so remove it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.h (convert_addresses): Remove function declaration.diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h --- a/gcc/ada/adaint.h +++ b/gcc/ada/ad

[Ada] Fix clearly unintentional dead analysis of attribute Code_Address

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag a clearly unintentional dead call to Set_Address_Taken in analysis of Code_Address attribute. This patch resurrects the dead code, which is worth fixing regardless of the new warning. Tested on x86_64-

[Ada] Remove redundant guards in detection of unreachable code

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Check_Unreachable_Code is only called on nodes belonging to a list of statements (and it wouldn't make sense to call it on anything else). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Remove redundant guard; the call t

[Ada] Remove comment about a long gone formal verification mode

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Remove outdated a comment about the very first SPARK experiments in GNAT. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Missing_Return): Remove outdated comment.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ad

[Ada] Add RM reference to check for functions without a return statement

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Add comment to explain why we have an error and not just a warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Missing_Return): Add reference to an RM rule.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/

[Ada] Combine system.ads files - vxworks6 constants.

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Systemitize Word_Size and Memory_Size declarations rather than hard code with numerical values or OS specific Long_Integer size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/system-vxworks-ppc-kernel.ads (Word_Size): Compute based on Standard'Word_Size.

[Ada] Perform object rewriting as renaming only in the expander

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
The rewriting as renaming optimization for object declarations is done partly during analysis, guarded with Expander_Active, and partly during expansion, so it makes sense to do it entirely during expansion. This merges the two cases and removes obsolete or unnecessary conditions guarding the tran

[Ada] Remove redundant guard for call to List_Length with a No_List

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to a new detection of uninitialised local scalar objects; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Analyze_Block_Statement): Call to List_Length with No_List is safe and will return zero.diff --git a/g

[Ada] Cleanup in error about unreachable code

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup only; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Avoid explicit use of Sloc; this should also help when we finally use Source_Span for prettier error messages.diff --git a/gcc/ada/sem

[Ada] Spurious error on qualified prefix in Pack.Func'Result

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
When using a qualified name such as Pack.Func as the prefix of a 'Result attribute reference, the prefix is not fully resolved and may contain a chain of homonyms. Look for the expected function in the homonym chain instead of issuing an error if the first one is not the expected one. Tested on x8

[Ada] Cleanup repeated code for aggregate constraints checks

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to examining uses of Check_Unset_Reference for improved detection of uninitialised scalar objects. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Aggregate_Constraint_Checks): Fix whitespace; refactor repea

[Ada] Remove exception propagation during bootstrap

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
To help the bootstrap path, we want to keep the compiler free from any exception propagation during bootstrap. This has been broken recently in various places. Also introduce a way to more easily detect such breakage via the -DNO_EXCEPTION_PROPAGATION which can now be used as part of BOOT_CFLAGS.

[Ada] Remove unnecessary dead code after calls to nonreturning procedures

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag some dead defensive code. Comments next to this code suggest that it was added to please some ancient version of the compiler, but recent releases of GNAT do not require such a code. Tested on x86_64-pc

[Ada] Remove repeated analysis for pragma Thread_Local_Storage

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
When analysing pragma Thread_Local_Storage its argument is analysed by the call to Check_Arg_Is_Library_Level_Local_Name. There is no need to reanalyse it. Code cleanup; behaviour is not affected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Analyze_Pragma):

[Ada] Annotate GNAT.Sockets with No_Return aspects

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Opportunity for extra annotations spotted while fixing detection of unreachable code that follows calls to procedures annotated with No_Return. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-socket.adb (Raise_Host_Error): Add No_Return aspect. (Raise_GAI_E

[Ada] Remove return statements after procedure calls that don't return

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
A new warning about unreachable code that follows calls to procedures with No_Return would flag many unnecessary return statements. Those returns statements were applied inconsistently, so this patch is actually more a style cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Misc cleanup related to finalization

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
This patch cleans up some code issues found while working on finalization, and adds some debugging aids. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb: Change two constants Is_Protected_Body and Is_Prot_Body to be Is_Protected_Subp_Body; these are not t

[Ada] Remove redundant protection against empty lists

2022-07-05 Thread Pierre-Marie de Rodat via Gcc-patches
Calls to First on No_List intentionally return Empty node, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_code.adb (Setup_Asm_IO_Args): Remove guard against No_List. * par

<    21   22   23   24   25   26   27   28   29   30   >