[Ada] Memory corruption when using formal hashed sets or maps

2019-07-11 Thread Pierre-Marie de Rodat
Add a check to avoid causing a buffer overflow when the map is empty Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-11 Claire Dross gcc/ada/ * libgnat/a-cfhama.adb, libgnat/a-cfhase.adb (Free): Do not reset the Has_Element flag if no element is freed.--- gcc/ada/li

[Ada] Minimal binder

2019-07-11 Thread Pierre-Marie de Rodat
The new minimal binder option ("-minimal") suppresses the generation of binder objects that are not strictly required for program operation. This option is suitable for space constrained applications and comes with the restriction that programs can no longer be debugged using GDB. Tested on x86_64

[Ada] Link error due to negated intrinsic comparison

2019-07-11 Thread Pierre-Marie de Rodat
This patch corrects the resolution of operator "not" when the expression being negated is an equality operator to prevent the transformation of an intrinsic equality operator into a function call. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-11 Hristian Kirtchev gcc/ada/

[Ada] Avoid spurious warning on assertions with Loop_Entry

2019-07-11 Thread Pierre-Marie de Rodat
When the Loop_Entry attribute is used inside a loop invariant or another assertion where it is allowed, it may lead to spurious warnings on conditions that are detected to be always valid. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-11 Yannick Moy gcc/ada/ *

[Ada] Missing finalization of private protected type

2019-07-11 Thread Pierre-Marie de Rodat
This patch updates the analysis of protected types to properly mark the type as having controlled components when it contains at least one such component. This in turn marks a potential partial view as requiring finalization actions. -- Source -- -- types.ads with Ada.

[Ada] Remove redundant predicate checks

2019-07-11 Thread Pierre-Marie de Rodat
This patch removes redundant dynamic predicate checks generated by type conversions in various contexts. The patch also recognizes additional such checks that can be evaluated statically when applied to constant values. No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Elaboration order v4.0 and output of dependencies

2019-07-11 Thread Pierre-Marie de Rodat
This patch adds a missing case to the mechanism that outputs the elaboration order dependencies of units. -- Source -- -- pack.ads package Pack is procedure Force_Body; end Pack; -- pack.adb package body Pack is procedure Force_Body is null; end Pack; -- mai

[Ada] Refactor ownership pointer checking in SPARK as a generic

2019-07-11 Thread Pierre-Marie de Rodat
Ownership checking as done in SPARK should be applied only to SPARK code, which requires GNATprove knowledge of the SPARK_Mode boundary. Transform the checking unit into a generic to allow passing in the knowledge from GNATprove to that unit in GNAT sources. Keeping the code in GNAT sources makes

[Ada] Crash on protected type with self-referential component

2019-07-11 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a declarastion for a protected type PT when one of its private component is of type access PT. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-11 Ed Schonberg gcc/ada/ * exp_ch9.adb (Expand_N_Protected_Type_Declaaration): New sub

[Ada] Fix internal error on array slice in loop and Loop_Invariant

2019-07-22 Thread Pierre-Marie de Rodat
This fixes an internal error caused by the presence of an Itype in a wrong scope. This Itype is created for an array slice present in the condition of a while loop whose body also contains a pragma Loop_Invariant, initially in the correct scope but then relocated into a function created for the pr

[Ada] Spurious warning about a useless assignment

2019-07-22 Thread Pierre-Marie de Rodat
This patch removes a spurious warning about a useless assignment, when a composite object is the target of an assignment and is an actual for an out parameter in a subsewuent call, and there is an intervening use of the object as the prefix of a selected component in an intervening operation. Test

[Ada] Crash in C++ constructor without external and link name

2019-07-22 Thread Pierre-Marie de Rodat
The compiler blows up processing the declaration of a tagged type variable that has a C++ constructor without external or link name. After this patch the frontend reports an error. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Javier Miranda gcc/ada/ * freeze.adb (Free

[Ada] Ensure Ctrl-C is not emited on terminated processes

2019-07-22 Thread Pierre-Marie de Rodat
Due to the reuse policy of PID on Windows. Sending a Ctrl-C to a dead process might result in a Ctrl-C sent to the wrong process. The check is also implemented on Unix platforms and avoid unecessary waits. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Nicolas Roche gcc/ada/

[Ada] Incorrect values in conversion from fixed-point subtype with 'Small

2019-07-22 Thread Pierre-Marie de Rodat
This patch fixes incorrect computations involving a fixed-point subtype whose parent type has an aspect specification for 'Small. Executing the following: gnatmake -q conv ./conv must yield: 9000.00 9.00E+03 9000.00 9.00E+03 9.000

[Ada] Fix wrong assumption on bounds in GNAT.Encode_String

2019-07-22 Thread Pierre-Marie de Rodat
This fixes a couple of oversights in the GNAT.Encode_String package, whose effect is to assume that all the strings have a lower bound of 1. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Eric Botcazou gcc/ada/ * libgnat/g-encstr.adb (Encode_Wide_String): Fix oversight.

[Ada] Fix missing Constraint_Error for Enum_Val attribute

2019-07-22 Thread Pierre-Marie de Rodat
This fixes an old issue involving the Enum_Val attribute: it does not always raise a Constraint_Error exception when the specified value is not valid for the enumeration type (instead a modulo computation is applied to the value). Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Eric

[Ada] Premature finalization of controlled temporaries in case expressions

2019-07-22 Thread Pierre-Marie de Rodat
The compiler was generating finalization of temporary objects used in evaluating case expressions for controlled types in cases where the case statement created by Expand_N_Expression_With_Actions is rewritten as an if statement. This is fixed by inheriting the From_Condition_Expression flag from t

[Ada] Type inconsistency in floating_point type declarations

2019-07-22 Thread Pierre-Marie de Rodat
This patch fixes an inconsistency in the typing of the bounds of a floting point type declaration, when some bound is given by a dtatic constant of an explicit type, instead of a real literal, Previous to this patch the bound of the type retained the given type, leading to spurious errors in Codepe

[Ada] Further fix non-stored discriminant in aggregate for GNATprove

2019-07-22 Thread Pierre-Marie de Rodat
GNATprove expects discriminants appearing in aggregates and their types to be resolved to stored discriminants. This extends the machinery that makes sure this is the case for default initialization expressions so as to also handle component associations in these expressions. Tested on x86_64-pc-

[Ada] Spurious error on private subtype of derived access type

2019-07-22 Thread Pierre-Marie de Rodat
This patch fixes a spurious type error on a dynamic predicate on a subtype of a private type whose full view is a derived access type. Prior to it, the base type of the subtype would appear to be the parent type of the derived type instead of the derived type itself, leading to problems downstream.

[Ada] Remove obsolete Is_For_Access_Subtype machinery

2019-07-22 Thread Pierre-Marie de Rodat
This change removes the Is_For_Access_Subtype machinery from the compiler. This machinery was devised a long time ago to deal with a peculiarity of the freezing for access-to-record subtypes but has been degenerate for quite some time now and does not seem to serve any useful purpose at this point

[Ada] Internal error on iterator for limited private discriminated type

2019-07-22 Thread Pierre-Marie de Rodat
This patch further extends the short-circuit, aka optimization, present in the Check_Constrained_Object procedure used for renaming declarations to all limited types, so as to prevent type mismatches downstream in more cases. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Eric Botc

[Ada] Fix spurious loop warning for function with Out parameter

2019-07-22 Thread Pierre-Marie de Rodat
The compiler gives a spurious warning about a possible infinite while loop whose condition contains a call to a function that takes an Out or In/Out parameter and whose actual is a variable that is not modified in the loop, because it still thinks that functions can only have In parameters. Tested

[Ada] Fix spurious visibility error for tagged type with inlining

2019-07-22 Thread Pierre-Marie de Rodat
This fixes a spurious visibility error for the very peculiar case where an operator that operates on the class-wide type of a tagged type is declared in a package, the operator is renamed in another package where a subtype of the tagged type is declared, and both packages end up in the transititive

[Ada] Misleading warning on variable not assigned

2019-07-22 Thread Pierre-Marie de Rodat
This patch removes a warning on a referenced entity with no explicit prior assignment, if the type of the entity has Preelaborable_Initialixation, such as Exception_Occurrence. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Ed Schonberg gcc/ada/ * sem_warn.adb (Check_Re

[Ada] Issue warning or error message on ignored typing constraint

2019-07-22 Thread Pierre-Marie de Rodat
GNAT ignores the discriminant constraint on a component when it applies to the type of the record being analyzed. Now issue a warning on Ada code when ignoring this constraint, or an error on SPARK code. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Yannick Moy gcc/ada/

[Ada] Optimization loses exception in improper use of 'Value

2019-07-22 Thread Pierre-Marie de Rodat
This patch prevents an improper removal of an evaluation of attribute 'Value on an illegal input that will raise Constraint_Error, when a subsequent use of this evaluation might be optimized away by the back-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Ed Schonberg gcc/ad

[Ada] Spurious error passing access to class-wide interface type

2019-07-22 Thread Pierre-Marie de Rodat
The compiler reports an spurious error when the formal parameter of a subprogram is an access to a class wide interface type and the actual parameter is an allocator of an object covering such interface type. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Javier Miranda gcc/ada/

[Ada] Remove misleading warning/suggestion in membership test

2019-07-22 Thread Pierre-Marie de Rodat
This patch removes a warning on a membership test whose right operand is given by a range. In many cases the check can be replaced by the use of attribute 'Valid, but if the bounds of range are type conversion this replacement would be invorrect and the warning and suggestion are misleading. Teste

[Ada] Adapt ownership checking in SPARK to traversal functions

2019-07-22 Thread Pierre-Marie de Rodat
A traversal function, especially when implemented as an expression function, may need to return an if-expression or case-expression, while still respecting Legality Rule SPARK RM 3.10(5). This case is now allowed in GNATprove. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, comm

[Ada] Overhaul code implementing conversions involving fixed-point types

2019-07-22 Thread Pierre-Marie de Rodat
This ovehauls the code implementing conversions involving fixed-point types in the front-end because it leaks the Do_Range_Check flag in several places to the back-end, which is a violation of the documented interface between front-end and back-end. This also does a bit of housekeeping work throug

[Ada] More complete information level for -gnatR4 output

2019-07-22 Thread Pierre-Marie de Rodat
This instructs -gnatR4 to also list the Etype of user-declared objects if it is compiler-generated, for example in: package P2 is Arr_V : array (1 .. 5) of Integer; end P2; Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-22 Eric Botcazou gcc/ada/ * repinfo.adb (List_En

[Ada] Fix missing check for no-op conversion to fixed-point type

2019-07-22 Thread Pierre-Marie de Rodat
This plugs a small loophole in the compiler for the case of a multiplication or a division in a fixed-point type wrapped in a no-op conversion, e.g. to the same fixed-point type. The front-end fails to generate a range check for the operation. This used to be caught by the back-end, which would g

[Ada] Minor tweak to -gnatR output

2019-07-23 Thread Pierre-Marie de Rodat
This makes sure that the numbers present in the -gnatR output are printed in decimal format in all cases, since the hexadecimal format is not compatible with the JSON syntax. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-23 Eric Botcazou gcc/ada/ * repinfo.adb (List_Compo

[Ada] Issue error on SPARK ownership rule violation

2019-07-23 Thread Pierre-Marie de Rodat
A modified rule in SPARK RM specifies that object declarations of anonymous access type should only occur immediately in subprogram, entry or block. Now checked. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-23 Yannick Moy gcc/ada/ * se

[Ada] Iterators are view-specific

2019-07-23 Thread Pierre-Marie de Rodat
Operational aspects, such as Default_Iterator, are view-specific, and if such an aspect appears on the full view of a private type, an object of the type cannot be iterated upon if it is not in the scope of the full view, This patch diagnoses properly an attempt to iterate over such an object. Tes

[Ada] Fix binding of ghost units with finalizer

2019-07-23 Thread Pierre-Marie de Rodat
Linking of an enabled ghost unit which requires a finalizer lead to an error, as the name generated by the binder for calling the finalizer was not the same as the name chosen by the compiler. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-23 Yannick Moy gcc/ada/

[Ada] Eliminate redundant overflow checks for conversions from fixed-point

2019-07-23 Thread Pierre-Marie de Rodat
This eliminates redundant overflow checks that are generated for conversions from fixed-point to integer types when range checks are also enabled (which is the default), as the former checks are subsumed into the latter checks. No functional changes. Tested on x86_64-pc-linux-gnu, committed on tr

[Ada] Plug small loophole in Generate_Range_Check

2019-07-23 Thread Pierre-Marie de Rodat
The Generate_Range_Check routine is responsible for generating range checks in the scalar case. It automatically deals with possible overflow in the process when the source and the target base types are different. However there is one case where overflow is not dealt with correctly, namely when t

Re: [PATCH] PR ada/89583, GNAT.Sockets.Bind_Socket fails with IPv4 address

2019-03-20 Thread Pierre-Marie de Rodat
Hello Simon, On 3/19/19 5:02 PM, Simon Wright wrote: Ping? Sorry for the delay! Thank you for the notice; I’ll try to get our fix ported as soon as possible (hopefully before the end of the week). Cheers, -- Pierre-Marie de Rodat

Re: [PATCH] PR ada/89583, GNAT.Sockets.Bind_Socket fails with IPv4 address

2019-03-22 Thread Pierre-Marie de Rodat
On 3/20/19 6:54 PM, Simon Wright wrote: Thanks, Pierre-Marie: it'd be a shame if 9.1 couldn't handle IPv4. Yes indeed :-) The change is ready to go: may I commit your testcase as well? -- Pierre-Marie de Rodat

[Ada] GNAT.Sockets: fix recent regressions

2019-03-22 Thread Pierre-Marie de Rodat
. (Is_IPv6_Address): Fix the number of expected colons. 2019-03-22 Simon Wright gcc/testsuite/ PR ada/89583 * gnat.dg/socket2.adb: New. -- Pierre-Marie de Rodat >From 5b516b731045b7100231eb5f059d35a357d296d5 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date:

[PATCH] Generalize overriding mechanism for debug info output options defaults

2016-08-18 Thread Pierre-Marie de Rodat
Hello, Currently, the VxWorks target overrides the defaults for debug info output options (DWARF version, strictness) in a target-specific options hook. This patch creates macros so that these defaults can be overriden in config headers. In particular, this will make it easier to have different

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

2016-08-18 Thread Pierre-Marie de Rodat
Hello, This enhances location description generation so that the generated opcodes for integer literals are as space-efficient when HOST_WIDE_INT is 64-bits large than when it's 32-bits large. In particular, this reduces the size of the opcodes generated to produce big unsigned literals using smal

[PATCH] DWARF: do not emit DW_TAG_variable to materialize DWARF procedures

2016-08-18 Thread Pierre-Marie de Rodat
Hello, For -gdwarf-3 and newer, the DWARF back-end sometimes generates DWARF procedures to factorize complex location descriptions. DWARF procedures can be materialized as DW_TAG_dwarf_procedure DIEs, but actually any DIE that can hold a DW_AT_location attribute is also accepted. Unlike what I t

[PATCH] DWARF: remove pessimistic DWARF version checks for imported entities

2016-08-18 Thread Pierre-Marie de Rodat
Hello, A check in dwarf2out_imported_module_or_decl prevents valid strict DWARF2 constructs such as DW_TAG_imported_declaration from being emitted in dwarf2out_imported_module_or_decl_1. The latter already protects the emission of newer DWARF tags with appropriate checks, so the one in the former

Re: [PATCH] Generalize overriding mechanism for debug info output options defaults

2016-08-18 Thread Pierre-Marie de Rodat
nice!). -- Pierre-Marie de Rodat

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

2016-08-18 Thread Pierre-Marie de Rodat
On 08/18/2016 01:29 PM, Trevor Saunders wrote: HOST_BITS_PER_WIDE_INT is now always 64, so you don't need that check. Good point, thank you! I’ll adapt the patch. -- Pierre-Marie de Rodat

Re: [PATCH] DWARF: do not emit DW_TAG_variable to materialize DWARF procedures

2016-08-18 Thread Pierre-Marie de Rodat
On 08/18/2016 02:39 PM, Richard Biener wrote: Ok. Thank you for the quick review! This is commited, now (revision 239575). -- Pierre-Marie de Rodat

Re: [PATCH] Generalize overriding mechanism for debug info output options defaults

2016-08-26 Thread Pierre-Marie de Rodat
at world (hooks). One good way to start thinking about this stuff is what would need to change to support a world where the target (or front-end) were a DSO and replaceable. Interesting, thank you! So, I hereby abandon this patch. ;-) -- Pierre-Marie de Rodat

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

2016-08-29 Thread Pierre-Marie de Rodat
TYPE_DECLs that have the same scope as their type, relocate the type DIE if it was generated without a scope. gcc/testsuite/ * gnat.dg/debug9.adb: New testcase. -- Pierre-Marie de Rodat >From 7b629a631b532d561ed66c0dc973dfbf1f5d Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date:

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

2016-08-31 Thread Pierre-Marie de Rodat
Hello, Ping for the patch submitted at <https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01314.html>. Also, here’s the update that Trevor suggested. Thanks! -- Pierre-Marie de Rodat >From da6753ad98127778e8923db63ce51b52a853ed17 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat

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

2016-09-06 Thread Pierre-Marie de Rodat
Hello, On 08/29/2016 11:03 AM, Pierre-Marie de Rodat wrote: Here is another attempt to solve the original issue. This time, with a proper testcase. ;-) Rebased against trunk, boostrapped and regtested on x86_64-linux. Ping for the patch submitted at <https://gcc.gnu.org/ml/gcc-patches/2

[Ada] Missing warning about replacement of warnings off for unreferenced

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue introduced by Q220-025 where the use of pragma warnings off applied to an unreferenced variable is not warned about the possibility of replacing with the more specific pragma unreferenced when using the -gnatw.w. -- Source -- -- p.adb proce

[Ada] Proper resolution of Initializes and Initial_Condition

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the processing of SPARK annotations Initializes and Initial_Condition to perform the resolution of the related expressions at the end of the enclosing package visible declarations. -- Source -- -- init_cond.ads package Init_Cond with SPARK_Mode,

[Ada] Remove obsolete comment for Generic_Parent

2017-10-14 Thread Pierre-Marie de Rodat
Routine [Set_]Generic_Parent can only be called on package, function and procedure specification nodes, as asserted in their bodies. It would crash when called for renaming or object declarations; the comment was most likely referring to some earlier implemenation idea. Tested on x86_64-pc-linux-g

[Ada] Variable assignments and reads in SPARK elaboration code

2017-10-14 Thread Pierre-Marie de Rodat
This patch reimplements the treatment of variable assignments and reads within SPARK elaboration code. The changes are as follows: 1) Diagnostics of variable assignments in elaboration code are now based on the rules in effect (either Ada or SPARK). 2) Variable assignments in Ada elaboration c

[Ada] Spurious ineffective use_type_clause warning on private type

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a defaulted formal subprogram was not being accounted for when checking for ineffective use_type_clauses on private types used as generic actuals. -- Source -- -- types.ads package Types is type Enum_1 is private; private type

[Ada] Missing validity check on record type component

2017-10-14 Thread Pierre-Marie de Rodat
The compiler may silently skip generating a validity check on a type conversion of a component of a record type. After this patch the error is reported on the following sources. pragma Initialize_Scalars; package Pkg is type T is record Major : Natural; Minor : Natural; end recor

[Ada] Fix performance regression of Ada.Numerics on 32-bit Windows

2017-10-14 Thread Pierre-Marie de Rodat
This fixes a run-time performance regression recently introduced on 32-bit Windows for Ada.Numerics by an unrelated change that exposed an old defect of the compiler on 32-bit Windows, namely that the Long_Long_Float type has got a wrong alignment of 8 instead of the expected 4. The following pack

[Ada] Premature evaluation of message string in Assert pragma

2017-10-14 Thread Pierre-Marie de Rodat
RM 11.4.2 stipulates that the optional string argument in an Assert pragma is evaluated only if the assertion fails and the string is incorporated into the raise statement. Previous to this patch the string expression was evaluated unconditionally, leading to unwanted side effects if its evaluation

[Ada] Repair ABI breakage on 32-bit x86/Linux

2017-10-14 Thread Pierre-Marie de Rodat
This repairs the ABI breakage for record types with Long_Float components introduced on 32-bit x86/Linux by the previous change. The Long_Float type is awkward on this platform because it has got a dual alignment setting: it's 8 for standalone object and array component and 4 for record component.

[Ada] Activation/suppression of SPARK elaboration rules

2017-10-14 Thread Pierre-Marie de Rodat
This patch utilizes compilation switch -gnatd.v to enforce the SPARK rules for elaboration in SPARK code. The affected scenarios are calls and instantiations. If the switch is active, the ABE mechanism will verify that the scenarios have fulfilled their Elaborate[_All] requirements. Otherwise the s

[Ada] Calls in preelaborated units and pragma Remote_Call_Interface

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the check which ensures that no call is executed in a preelaborated unit. The check now properly ignores a case where a generic unit is subject to pragma Remote_Call_Interface, and the call appears in the body. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-1

[Ada] Spurious elaboration error in SPARK

2017-10-19 Thread Pierre-Marie de Rodat
This patch corrects the diagnostics related to elaboration requirements of instantiations imposed on a unit. In addition, the patch updates two key routines to handle compilation unit instances. -- Source -- -- gnat.adc pragma SPARK_Mode (On); -- gen_pack.ads generi

[Ada] Small optimization in Sem_Ch4.Find_Concatenation_Types

2017-10-20 Thread Pierre-Marie de Rodat
The handling of string concatenation is quite inefficient in the front-end because the compiler generates a lot of implicit concatenation operators for array types and also enumeration types, and then walks the full list every time it needs to resolve a concatenation operator, in most cases for str

[Ada] Superfluous restriction on aspect Dimension applied to integer type

2017-10-20 Thread Pierre-Marie de Rodat
If the dimensioned root type is an integer type, it is not particularly useful, and fractional dimensions do not make much sense for such types, so previously we used to reject dimensions of integer types that were not integer literals. However, the manipulation of dimensions does not depend on the

[Ada] Be more permissive for comparisons with literals in dimension system

2017-10-20 Thread Pierre-Marie de Rodat
The dimension system in GNAT now allows to compare a dimensioned expression with a literal, but it issues a warning in this case if the literal is not zero. The following code compiles with warnings: $ gcc -c use_dims.adb 1. with System.Dim.Mks; use System.Dim.Mks; 2. 3. proc

[Ada] Fix inadequate silencing of errors in expression functions

2017-10-20 Thread Pierre-Marie de Rodat
Errors where previously silenced on expression functions, which caused some BUG BOX to be issued inside GNATprove, as the AST could be ill-formed. Now fixed. There is no example code as this only has an effect on GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-20 Yannick Moy

[Ada] Mark temporary entity created while removing side effects as internal

2017-10-20 Thread Pierre-Marie de Rodat
Temporary entities created by the frontend are now marked as internal to simplify their detection in the GNATprove backend. Also, by marking them as internal it is less likely that an extra code for their initialization will be created if pragma Initialize_Scalars is active (though I didn't check t

[Ada] Adjust new implementation of ABE detection to ZFP context

2017-10-20 Thread Pierre-Marie de Rodat
The new implementation of Access-Before-Elaboration detection can create new raise Program_Error statements at the very end of the front-end processing, which is too late in order for the first-line mechanism implementing the No_Exception_Propagation restriction present in the front-end to catch th

[Ada] Spurious error on partial parameterization

2017-10-20 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a defaulted formal package actual generated a spurious type mismatch error upon instantiation instead of beging accepted as per ARM 12.7 4.4/3. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-10-20 Justin Squirek * sem_ch12.adb (Ch

[Ada] Spurious warnings and errors on calls on synchronized interfaces

2017-10-20 Thread Pierre-Marie de Rodat
This patch fixes some spurious warnings and errors on dispatching calls to synchronized operations when the controlling formal of the operation is an access to interface type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-10-20 Ed Schonberg * sem_util.adb (Is_Contro

[Ada] Spurious ineffective use_clause warning

2017-10-20 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a child package included into the body of a parent forced checks on ineffective use clauses within the parent's spec to be checked early - leading to spurious warnings. -- Source -- -- pp.ads package PP is type Object is null reco

[Ada] Use the Monotonic Clock on Linux

2017-10-20 Thread Pierre-Marie de Rodat
The Posix method of calculating absolute deadlines is adopted in favor of latching the monotonic clock to a known epoch, as the Posix method is simpler and meets all the requirements of the Ada LRM. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-20 Doug Rupp * libgnarl/s-os

[PING*2][PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-07-24 Thread Pierre-Marie de Rodat
I would like to ping for the updated patch, originally submitted at <https://gcc.gnu.org/ml/gcc-patches/2017-05/msg02049.html>. Thank you in advance! -- Pierre-Marie de Rodat

[PATCH 0/2] Python testcases to check DWARF output

2017-07-26 Thread Pierre-Marie de Rodat
Hello, At the last GNU Cauldron, Richard Biener and I talked about DWARF output testing. Except for guality tests, which are disabled on several targets, the only way tests check the DWARF is scanning the annotated assembly (-dA), making it hard to write reliable tests. For instance, checking the

[PATCH 1/2] Introduce testsuite support to run Python tests

2017-07-26 Thread Pierre-Marie de Rodat
gcc/testsuite/ * lib/gcc-python.exp: New test library. * python/testutils.py: New Python helper. --- gcc/testsuite/lib/gcc-python.exp | 95 +++ gcc/testsuite/python/testutils.py | 45 +++ 2 files changed, 140 insertions(+) crea

[PATCH 2/2] Introduce Python testcases to check DWARF output

2017-07-26 Thread Pierre-Marie de Rodat
For now, this supports only platforms that have an objdump available for the corresponding target. There are several things that would be nico to have in the future: * add support for more DWARF dumping tools, such as otool on Darwin; * have a DWARF location expression decoder, to be able to

Re: [PATCH 0/2] Python testcases to check DWARF output

2017-07-26 Thread Pierre-Marie de Rodat
aybe in lib/gcc-python.exp? -- Pierre-Marie de Rodat

Re: [PATCH 1/2] Introduce testsuite support to run Python tests

2017-07-26 Thread Pierre-Marie de Rodat
boolean singleton "True"). I agree with you: I updated the patch on my machine. Thank you! -- Pierre-Marie de Rodat

Re: [PATCH 1/2] Introduce testsuite support to run Python tests

2017-07-27 Thread Pierre-Marie de Rodat
ait for further feedback, then. If needed I’ll turn all the .format into % operations. -- Pierre-Marie de Rodat

Re: [PATCH 2/2] Introduce Python testcases to check DWARF output

2017-07-27 Thread Pierre-Marie de Rodat
*and* to assess Python code coverage for them. I’ll do this if this proposal is in good way to be accepted. Hope this is constructive It totally was: thank you very much! -- Pierre-Marie de Rodat

Re: [PATCH 0/2] Python testcases to check DWARF output

2017-07-27 Thread Pierre-Marie de Rodat
like a huuuge task. I’ll let experts in this area comment. :-) -- Pierre-Marie de Rodat

Re: [PATCH 2/2] Introduce Python testcases to check DWARF output

2017-07-27 Thread Pierre-Marie de Rodat
generic, I think it would makes sense: for instance if the input source has only one structure field called “i”, then the above pattern will make it possible to match its type precisely. I think a separate .py for checking is required anyway for the more complex cases. I think so as well, for instance for the tests I sent so far. -- Pierre-Marie de Rodat

Re: [PATCH 1/2] Introduce testsuite support to run Python tests

2017-07-27 Thread Pierre-Marie de Rodat
k you. I’ll do this for the next patchset I’ll submit. -- Pierre-Marie de Rodat

[PING*3][PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-07-31 Thread Pierre-Marie de Rodat
Hello, Ping for the updated patch, originally submitted at <https://gcc.gnu.org/ml/gcc-patches/2017-05/msg02049.html>. Thank you in advance! -- Pierre-Marie de Rodat

Re: [PATCH 0/2] Python testcases to check DWARF output

2017-08-03 Thread Pierre-Marie de Rodat
and I don’t think we can do that with Zwerg (no way to pass something like environment variables). Of course, I have written a “competitor” tool: I guess my judgment is biased. :-) So other opinions are welcome! -- Pierre-Marie de Rodat

Re: [PATCH 1/2] Introduce testsuite support to run Python tests

2017-08-03 Thread Pierre-Marie de Rodat
On 08/02/2017 08:43 PM, Jeff Law wrote: If it was trivial, then let's support 2.6. But if it's nontrivial, I'd support stepping to something more modern. It is trivial. I’ve done it locally. :-) -- Pierre-Marie de Rodat

[PATCH v2] Python testcases to check DWARF output

2017-08-09 Thread Pierre-Marie de Rodat
bug/dwarf2-py/var2.py, gnat.dg/dwarf/debug9.adb, gnat.dg/dwarf/debug9.py, gnat.dg/dwarf/debug11.adb, gnat.dg/dwarf/debug11.py, gnat.dg/dwarf/debug12.adb, gnat.dg/dwarf/debug12.ads: New tests. -- Pierre-Marie de Rodat >From 29a482344c7a39d441da

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-08-11 Thread Pierre-Marie de Rodat
a couple of Fortran tests (at -O3 -g). Also, as the gcc_unreachable appears in an IF block, I turned it into a gcc_assert and remove the corresponding IF. Here is the final patch version, bootstrapped and regtested on x86_64-linux. -- Pierre-Marie de Rodat >F

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-08-12 Thread Pierre-Marie de Rodat
On 08/11/2017 11:29 PM, Jason Merrill wrote: OK. Committed. Thank you for your sustained review effort, Jason. :-) -- Pierre-Marie de Rodat

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-09-04 Thread Pierre-Marie de Rodat
s. As discussed on IRC, I’m not very familiar with debug info generation for optimized code yet anyway. ;-) Are there still pending issues with this? Also, do you think we can port the fix for PR79542 on the 7 release branch? -- Pierre-Marie de Rodat

Re: [PATCH v2] Python testcases to check DWARF output

2017-09-04 Thread Pierre-Marie de Rodat
Hello, I would like to ping for the patch I submitted at <https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00653.html>. Thank you in advance! -- Pierre-Marie de Rodat

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-09-05 Thread Pierre-Marie de Rodat
On 09/04/2017 11:26 AM, Richard Biener wrote: No more pending issues and yes, I guess the fix is ok for the branch. Ok, thanks! This is now comitted on the 7 release branch. -- Pierre-Marie de Rodat

Re: [PATCH v2] Python testcases to check DWARF output

2017-09-06 Thread Pierre-Marie de Rodat
dback. :-) -- Pierre-Marie de Rodat

[PATCH] [PR82155] Fix crash in dwarf2out_abstract_function

2017-09-11 Thread Pierre-Marie de Rodat
Hello, This patch is an attempt to fix the crash reported in PR82155. When generating a C++ class method for a class that is itself nested in a class method, dwarf2out_early_global_decl currently leaves the existing context DIE as it is if it already exists. However, it is possible that this cal

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-05-26 Thread Pierre-Marie de Rodat
was still allowed in gen_typedef_die. So here’s the update patch: bootstrapped and regtested fine on x86_64-linux. -- Pierre-Marie de Rodat >From 334338c3ac5dbdeb3981a6302259d0be0b5efc11 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Tue, 9 May 2017 12:24:36 +0200 Subject: [PATCH] [P

[PATCH 2/2] DWARF: make it possible to emit debug info for declarations only

2017-05-29 Thread Pierre-Marie de Rodat
Hello, The DWARF back-end used to systematically ignore file-scope function and variable declarations. While this is justified in language like C/C++, where such declarations can appear in several translation units and thus bloat uselessly the debug info, this behavior is counter-productive in la

[PATCH 1/2] gimplify_modify_expr: avoid DECL_DEBUG_EXPR links across functions

2017-05-29 Thread Pierre-Marie de Rodat
Hello, An upcoming patch exposes a bug in gimplify_modify_expr. There, we try not to create DECL_DEBUG_EXPR links across functions, however we don't check that *FROM_P actually belongs to the current function before modifying it. This patch fixes this oversight. Bootstrapped and regtested on x8

<    19   20   21   22   23   24   25   26   27   28   >