[PATCH] Add extensions to dwarf2.def

2015-06-09 Thread Pierre-Marie de Rodat
ed. Thank you in advance! include/ * dwarf2.def (DW_TAG_GNU_rational_constant): New tag. (DW_AT_GNU_numerator, DW_AT_GNU_denominator): New attributes. include/ * dwarf2.def (DW_AT_GNU_bias): New attribute. -- Pierre-Marie de Rodat == Introduction == Ada makes it possible

[PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-09 Thread Pierre-Marie de Rodat
ested on x86_64-linux. Ok to commit? Thank you in advance! gcc/ChangeLog * dwarf2out.c (lookup_context_die): Return the DIE for the current compilation unit when the input context is a TRANSLATION_UNIT_DECL. -- Pierre-Marie de Rodat extern int bar(int a); int foo(int a)

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-10 Thread Pierre-Marie de Rodat
). So here's a patch that introduce a register_main_translation_unit debug hook: is this what you had in mind? This works for me on the 4.9 branch and on mainline as well, regtested on x86_64-linux. -- Pierre-Marie de Rodat >From 285ea98dfdf3d45f32fc0141aa182f07d172612d Mon Sep 17 00:00:00

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-10 Thread Pierre-Marie de Rodat
hime in. Thank you very much. :-) I will soon become unavailable until July, so I think I'll wait until then to commit anyway. -- Pierre-Marie de Rodat

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-11 Thread Pierre-Marie de Rodat
ingly, leaving the GCC 5 branch with the original fix. That sounds perfect: thank you Richard! I am about to commit the original fix on mainline: should I still open a bugreport before commiting it to the GCC 5 branch? -- Pierre-Marie de Rodat

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-11 Thread Pierre-Marie de Rodat
. Original fix pushed on both trunk and the GCC 5 branch. Thank you very much for your help! Should I close the PR, now? -- Pierre-Marie de Rodat

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-12 Thread Pierre-Marie de Rodat
On 06/12/2015 07:41 AM, Richard Biener wrote: On June 12, 2015 2:30:36 AM GMT+02:00, David Edelsohn wrote: This patch broke AIX bootstrap because dbxout.c was not updated for the XCOFF_DEBUGGING_INFO case. OK. Thanks Richard. Sorry about that and thank you for the fix! -- Pierre-Marie de

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-12 Thread Pierre-Marie de Rodat
as well. May I? -- Pierre-Marie de Rodat

Re: [PATCH][PR debug/65549] Restore DW_AT_abstract_origin for cross-unit call sites

2015-06-12 Thread Pierre-Marie de Rodat
On 06/12/2015 01:11 PM, Richard Biener wrote: By the way, I think we should apply this fix to the GCC 5 branch as well. May I? Yes Done. Thanks again! -- Pierre-Marie de Rodat

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

2014-11-05 Thread Pierre-Marie de Rodat
Hello, Ping for https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00694.html Thanks in advance! Regards, -- Pierre-Marie de Rodat

[Ada] Missing check on if-expression

2018-12-03 Thread Pierre-Marie de Rodat
This patch fixes a constraint check on a dependent expression of an if-expression, when the context if given by a slice or the 'Range of an array. The constraint check is applied if the context is constrained, but the corresponding flag was not set for the index subtype generated for a slice (expli

[Ada] Adjust the default MALLOC_OBSERVABLE_ALIGNMENT to 2 * POINTER_SIZE

2018-12-03 Thread Pierre-Marie de Rodat
Instead of 2 * LONG_TYPE_SIZE. POINTER_SIZE is believed to be the correct base on more configurations than LONG_TYPE_SIZE and this adjustment prevents the need for local patches to compensate on configurations where the latter is inappropriate, for example x86_64-mingw. Tested on x86_64-pc-linux-g

[Ada] Gigi support for OpenACC pragmas

2018-12-03 Thread Pierre-Marie de Rodat
Matching front-end bits to support Acc_Kernels, Acc_Parallel, Acc_Loop and Acc_Data. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-03 Olivier Hainque gcc/ada/ * gcc-interface/lang.opt (fopenacc): New option for Ada. * gcc-interface/misc.c (gnat_handle_option): Han

[Ada] Fix assertion failures with -gnatde and -gnatdv

2018-12-03 Thread Pierre-Marie de Rodat
This fixes a couple of assertion failures when using -gnatde and -gnatdv on a compiler built with assertions enabled. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-03 Eric Botcazou gcc/ada/ * einfo.adb (Write_Entity_Info): Don't take Scope of Stand

[Ada] Fix problematic overloading of operator in Ada 95 mode

2018-12-03 Thread Pierre-Marie de Rodat
The change reverts the test deciding whether an initialization procedure can be inherited from parent to derived type to the original implementation, which allowed inheriting a null procedure. This prevents the creation of another null initialization procedure for the derived type, which in turn c

[Ada] Fix internal error on package instantiation on private type

2018-12-03 Thread Pierre-Marie de Rodat
This fixes an assertion failure in gigi triggered by the instantiation of a generic package, in a visible part of another package, done on a private type whose full view is a type derived from a scalar or an access type. The problem is that the front-end creates and inserts two different freeze no

[Ada] A task not executing an entry call consumes an Entry_Call slot

2018-12-03 Thread Pierre-Marie de Rodat
This patch resolves the issue where the ATC Level of a task's first Entry_Call slot corresponds to a task not currently making an entry call. Consequently, the first slot is never used to record an entry call. To resolve this, the ATC Level of a such a task is now one less than the first index of t

[Ada] Add leap seconds for 2015 and 2016

2018-12-03 Thread Pierre-Marie de Rodat
The following patch updates Ada.Calendar and helper utility Xleaps to include the leap seconds for years 2015 and 2016. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-03 Hristian Kirtchev gcc/ada/ * libgnat/a-calend.adb: Update the number of leap seconds. Add the h

[Ada] Fix recent regression on array aggregate with dynamic subtype

2018-12-03 Thread Pierre-Marie de Rodat
This prevents either a crash or an assertion failure in gigi on an array with dynamic subtype that is wrongly flagged as static by the front-end because of a recent improvement made in the handling of nested aggregates. The patch reuses the existing Static_Array_Aggregate predicate instead of fixi

[Ada] Fixes for various wrong and missing error messages on ACATS B85100[567]

2018-12-03 Thread Pierre-Marie de Rodat
GNAT was missing errors as well as issuing messages on legal lines in new ACATS tests for illegal renamings of discriminant-dependent components. Cases that are fixed include object names involving qualified expressions, dereference cases, and generic formal access and formal derived types. Better

[Ada] Spurious error on dependent expression that is an array

2018-12-03 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on a array expression that is a dependent expression of an if-expression, when the length of the array matches that imposed by the context, but the bounds of both differ, in particular when the expression and the context are both null arrays with different bounds.

[Ada] Suppress call to Initial_Condition when the annotation is ignored

2018-12-11 Thread Pierre-Marie de Rodat
This patch suppresses the generation of the Initial_Condition procedure tasked with verifying the run-time semantics of the pragma when the pragma is ignored by means of -gnata, pragma Assertion_Policy, etc. -- Source -- -- all_asserts_off.adc pragma Assertion_Policy (

[Ada] Crash on nesting of subunits with bodies acting as specs

2018-12-11 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a set of nested subunits including subprogram subunits acting as bodies would cause a crash when a child subunit "withs" an ansestor in certain instances due to a mismanagment of the scope stack. -- Source -- -- w.ads package W is e

[Ada] Fix an ICE on instantiated subprogram with -gnatc

2018-12-11 Thread Pierre-Marie de Rodat
The following should compile quietly: $ gcc -c p-proc.ads -gnatc procedure P.Proc is new G; with Q; package P is generic procedure G; end P; with System; with Unchecked_Conversion; package Q is generic package Inner_G is type T is access all Integer; function Cnv is new Unche

[Ada] Remove vxworks*-crtbe-link.spec

2018-12-11 Thread Pierre-Marie de Rodat
The VxWorks crtbe are now part of libgcc, needed to support C++ on this target. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Jerome Lambourg gcc/ada/ * Makefile.rtl, gcc-interface/Makefile.in: Remove crtbe bits for VxWorks. * libgnat/system-vxworks-arm

[Ada] Spurious visibility error on aspect Predicate

2018-12-11 Thread Pierre-Marie de Rodat
The GNAT-defined aspect Predicate has the same semantics as the Ada aspect Dynamic_Predicate, including direct visibility to the components of a record type to which the aspect applies. The following must compile quietly: gcc -c integer_stacks.ads pragma SPARK_Mode (On); with Bounded_St

[Ada] Spurious errors on aspect specifications in generic units

2018-12-11 Thread Pierre-Marie de Rodat
This patch fixes spurious errors on aspect specifications on record types when the aspect expression references a component of the type that is not a discriminant. The patch also cleans up the legality checks on aspect specifications, and improves error message on illegal aspect specifications whos

[Ada] Additionsal trasformations for unnesting in package bodies

2018-12-11 Thread Pierre-Marie de Rodat
This patch extends the previous algorithm for creating an explicit elaboration procedure for a package body when expansion generates subprograms in the statement part of the body. For unnesting to work properly, these subprograms must appear within an explicit subprogram body so that uplevel refere

[Ada] Better error message from GNATprove on illegal switch

2018-12-11 Thread Pierre-Marie de Rodat
When a compilation switch is wrongly passed to GNATprove without the leading hyphen, this patch issues a clear error message instead of the obscure 'usage' message previously displayed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Yannick Moy

[Ada] Stubs that complete generic subprogram do have a "prior declaration"

2018-12-11 Thread Pierre-Marie de Rodat
The intuition behind the Is_Subprogram_Stub_Without_Prior_Declaration utility routine is to detect stubs that act as subprogram declarations and False on stubs that act as completions. This behaviour is now fixed for stubs that correspond to generic subprogram declarations. This patch affects a ro

[Ada] Support access types in GNATprove

2018-12-11 Thread Pierre-Marie de Rodat
SPARK RM has been updated to support access types in SPARK. Part of this support is that now SPARK RM 3.1 lists access types as having full default initialization. Now updated. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Yannick Moy gcc/ada

[Ada] Complete implementation of RM C.6(19) clause

2018-12-11 Thread Pierre-Marie de Rodat
This ensures that the compiler fully implements the C.6(19) clause of the Ada Reference Manual and gives a warning when the clause does change the passing mechanism of the affected parameter. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Eric Botcazou gcc/ada/ * fe.h (

[Ada] Remove vxlink and vxaddr2line from this repository

2018-12-11 Thread Pierre-Marie de Rodat
Those tools need a dedicated repository as they're VxWorks specific and not related with the Ada front-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Jerome Lambourg gcc/ada/ * vxaddr2line.adb, vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb, vxlink-link.

[Ada] Crash on ignored Ghost expression function

2018-12-11 Thread Pierre-Marie de Rodat
This patch updates freezing to ensure that freeze nodes are inserted into the tree when the entity being frozen is non-Ghost, and the context is an ignored Ghost spec expression. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Hristian Kirtchev gcc/ada/ * exp_util.adb (I

[Ada] Crash on generic instantiation in ignored Ghost context

2018-12-11 Thread Pierre-Marie de Rodat
The following patch corrects the freezing of entities to properly preserve all freeze nodes in case of recursive freezing when the context is ignored Ghost, and the construct frozen is non-Ghost. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Hristian Kirtchev gcc/ada/

[Ada] Crash on compilation unit function that builds in place

2018-12-11 Thread Pierre-Marie de Rodat
This patch fixes a crash on a function that builds its limited result in place. Previously this was handled properly only if the function was a child unit. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Ed Schonberg gcc/ada/ * sem_ch3.adb (Build_Itype_Reference): Handle

[Ada] Missing predicate check on declaration with aggregate expression

2018-12-11 Thread Pierre-Marie de Rodat
This patch adds a missing predicate check on the initial value of an object whose declaration initializes the object with an aggregate. Such a declaration is marked No_Initialization to prevent a call to a default initialization procedure, but the check is needed on the value of the aggregate. Exe

[Ada] gnatbind: ghost code with -gnatQ

2018-12-11 Thread Pierre-Marie de Rodat
This patch fixes a bug where if a library unit is compiled with -gnatQ, and that library unit is an ignored Ghost unit, then gnatbind silently fails. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Bob Duff gcc/ada/ * gnat1drv.adb (gnat1drv): Pass the correct Object valu

[Ada] Fix setting of Has_Predicate flag for aggregate subtypes

2018-12-11 Thread Pierre-Marie de Rodat
This patch enures that the subtype of an aggregate has the Has_Predicate flag properly set if the array component has a predicate, including the case the predicate function for the component has not been constructed yet. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Ed Schonberg

[Ada] Plug small loophole with pathological packed array type

2018-12-11 Thread Pierre-Marie de Rodat
This fixes a crash in gigi on a pathological packed array type, whose component type is a record type without representation clause or packing but with a clause that bumps its size to a non-multiple value of the storage unit. In this case, the front-end fails to detect that calls to the packing ma

[Ada] Volatility, validity checks, and System.Aux_DEC

2018-12-11 Thread Pierre-Marie de Rodat
This patch updates validity checks to prevent the validation of an by-reference formal parameter because the parameter is not being read in the process. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Hristian Kirtchev gcc/ada/ * checks.adb: Add with and use clauses for

[Ada] Improve error message when named number passed as global item

2018-12-11 Thread Pierre-Marie de Rodat
When a named number is used in Global/Depends contracts as global item, the error message could be confusing to users new to Ada. Now the message explains that named numbers are not objects. For instance on the following illegal code snippet: $ gcc -c bad_global.ads 1. package Bad_Glob

[Ada] Do not expand code inside ignored ghost bodies

2018-12-11 Thread Pierre-Marie de Rodat
While ignored ghost code is not compiled into the executable, it may lead to compilation errors when it makes use of language features requiring runtime support that is not available in the available runtime library. These errors are spurious, as the executable will never call in these runtime uni

[Ada] Spurious error with pragma Thread_Local_Storage

2018-12-11 Thread Pierre-Marie de Rodat
The following patch modifies the checks related to pragma Thread_Local_Storage to correct a confusion in semantics which led to spurious errors. -- Source -- -- pack.ads package Pack is type Arr is array (1 .. 5) of Boolean; type Arr_With_Default is array (1 ..

[Ada] Crash on misplaced First operation for GNAT iterable type

2018-12-11 Thread Pierre-Marie de Rodat
This patch improves the handling of an improper declaaration of aspect First for a GNAT-defined iterable type, Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Ed Schonberg gcc/ada/ * sem_util.adb (Get_Actual_Subtype): Function can return type mark. (Get_C

[Ada] Add "Global => null" contracts to Ada.Calendar routines

2018-12-11 Thread Pierre-Marie de Rodat
Routines in Ada.Real_Time are already annotated with Global => null contracts to suppress spurious warnings from the flow analysis in GNATprove. This patch adds such contracts to Ada.Calendar. No change in runtime behavior expected. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-12-11 Pi

[Ada] Add special bypass for obsolete code pattern

2019-08-12 Thread Pierre-Marie de Rodat
This change prevents the analysis phase of the front-end from setting the Do_Range_Check flag in the very peculiar case of the source of a conversion whose result is passed by reference to a "valued procedure", because the expansion phase would not be able to generate the check. This pattern appea

[Ada] Fix incorrect Do_Range_Check on type conversion

2019-08-12 Thread Pierre-Marie de Rodat
This gets rid of another leak of the Do_Range_Check flag to the back-end which is specific to expression functions. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Eric Botcazou gcc/ada/ * checks.adb (Activate_Range_Check): Remove redundant argume

[Ada] Extended traversal subprograms for GNATprove

2019-08-12 Thread Pierre-Marie de Rodat
GNATprove needs traversal subprograms that do not simply traverse syntactic nodes like Atree.Traverse_Func and Atree.Traverse_Proc, but also traverse semantic nodes which are logically children of the nodes. Now available through Sem_Util.Traverse_More_Func and Sem_Util.Traverse_More_Proc. There i

[Ada] Adapt new extended traversal of AST to have optional part

2019-08-12 Thread Pierre-Marie de Rodat
The new extended traversal of the AST for GNATprove use now optionally traverses the ranges under Itypes, based on a formal parameter. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Yannick Moy gcc/ada/ * sem_util.adb, sem_util.ads (T

[Ada] Fix missing range check for In/Out parameter with -gnatVa

2019-08-12 Thread Pierre-Marie de Rodat
This plugs another small loophole in the front-end which fails to generate a range check for a scalar In/Out parameter when -gnatVa is specified. This also fixes a few more leaks of the Do_Range_Check flag on actual parameters, both in regular and -gnatVa modes, as well as a leak specific to expre

[Ada] Eliminate redundant range checks on conversions

2019-08-12 Thread Pierre-Marie de Rodat
This gets rid of redundant range checks generated in 5 out of the 9 cases of scalar conversions, i.e. (integer, fixed-point, floating-point) converted to (integer, fixed-point, floating-point). The problem is that the Real_Range_Check routine rewrites the conversion node into a conversion to the b

[Ada] Implement Ada.Directories.Hierarchical_File_Names

2019-08-12 Thread Pierre-Marie de Rodat
This patch corrects certain behaviors within Ada.Directories to better conform to conformance tests and implements the package Ada.Directories.Hierarchical_File_Names outlined in AI05-0049-1. Only partial test sources are included. -- Source -- -- main.ads with Ada.Di

[Ada] Prevent crash in Put_Scaled

2019-08-12 Thread Pierre-Marie de Rodat
This patch fixes a bug in Put_Scaled, which causes a crash when checks are on. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Bob Duff gcc/ada/ * libgnat/a-tifiio.adb (Put_Scaled): Prevent AA from being negative, since Field is range 0 .. something.--- gcc/ada/l

[Ada] Inconsistent compile time Constraint_Error warning

2019-08-12 Thread Pierre-Marie de Rodat
This patch corrects several bugs within the compiler which led to inconsistent handling of compile time Constraint_Errors. Notibly, subtype out of range checks which are only out of range of the subtype must be warnings while out of range checks where the value is out of range of the base type must

[Ada] Improve error message for Object_Size clause on dynamic array

2019-08-12 Thread Pierre-Marie de Rodat
This makes the compiler issue the same error: size clause not allowed for variable length type for an Object_Size clause on a variable-sized type as for a Size clause, for example on the following procedure: procedure P (X, Y : Integer) is subtype Sub is String (X .. Y) with Object_Size =

[Ada] Do not suppress checks in instances of internal generics

2019-08-12 Thread Pierre-Marie de Rodat
This patch removes suppression of checks in nested instances of internal packages. No test. This was inconsistent: only for packages, not for subprograms. Only for nested instantiations, not library level ones. Not for GNAT units. Furthermore, the user should have control via pragma Suppress or s

[Ada] Crash on illegal left-hand side in assignment of renamed variable

2019-08-12 Thread Pierre-Marie de Rodat
This patch fixes a crash on an assignment where the left-hand side is a renaming of a function call that does not involve ceiling priorities. This avoids a compiler crash in some cases, and prevents a useless retrieval and compilation of run-time packages. Tested on x86_64-pc-linux-gnu, committed

[Ada] Fix IPv6 numeric address detection

2019-08-12 Thread Pierre-Marie de Rodat
IPv6 numeric address can't have less than 2 colons. It fixes the error when Get_Host_By_Name called with hostname composed by only hexadecimal symbols. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Dmitriy Anisimkov gcc/ada/ * libgnat/g-socket.adb (Is_IPv6_Address): Ch

[Ada] More precise handling of Size/Object_Size in GNATprove

2019-08-12 Thread Pierre-Marie de Rodat
GNATprove does a partial expansion which did not allow getting the most precise value for attributes Size/Object_Size. Now fixed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Yannick Moy gcc/ada/ * exp_attr.adb, exp_attr.ads (Expand

[Ada] Missing check on outbound parameter of a non-null access type

2019-08-12 Thread Pierre-Marie de Rodat
This patch adds code to generate proper post-call checks when an actual for an in-out or out parameter has a non-null access type. No constraints are applied to an inbound access parameter, but on exit a not-null check must be performed if the type of the actual requires it. Tested on x86_64-pc-li

[Ada] New parameter Quiet for procedure GNAT.Command_Line.Getopt

2019-08-12 Thread Pierre-Marie de Rodat
Getopt procedure is parsing the command line or set of strings. If the command line contains unknown switch than the Getopt prints error message to the console and raises the exception Invalid_Switch. The printing can be inappropriate in some cases. The new parameter Quiet allows avoiding console o

[Ada] New aspect/pragma No_Caching for analysis of volatile data

2019-08-12 Thread Pierre-Marie de Rodat
A new aspect/pragma can be attached to volatile variables to indicate that such a variable is not used for interactions with the external world, but only that accesses to that variable should not be optimized by the compiler. This is in particular useful for guarding against fault injection. SPARK

[Ada] Remove doc for language version switches

2019-08-12 Thread Pierre-Marie de Rodat
Remove documentation for Ada language version switches, and note that they are no longer needed. These tools now silently ignore such switches, and process the file correctly no matter what version of Ada is used. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Bob Duff gcc/ada/

[Ada] Fix internal error on comparison of unaligned slices

2019-08-12 Thread Pierre-Marie de Rodat
This fixes an internal error in the code generator when it is trying to take the address of a slice which does not start on a byte boundary, in order to generate a comparison between slices with a dynamic length. This case is not supported by the code generator and comes from an explicit represent

[Ada] Prevent crash in Is_Reachable

2019-08-12 Thread Pierre-Marie de Rodat
This patch fixes a bug in Is_Reachable, which causes a crash when checks are on. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-12 Bob Duff gcc/ada/ * libgnat/a-cbmutr.adb (Is_Reachable): Declare Idx to be of the base subtype. Clearly it makes no sense to loop "wh

[Ada] Fix leak of Do_Range_Check flag in -gnatVa mode

2019-08-12 Thread Pierre-Marie de Rodat
This fixes a small glitch in Insert_Valid_Check, which needs to propagate the Do_Range_Check flag onto the rewritten expression, but uses its Original_Node as the source of the copy. Now Original_Node does not necessarily point to the node that was just rewritten, but to the ultimately original no

[Ada] Hang on loop in generic with subtype indication specifying a range

2019-08-12 Thread Pierre-Marie de Rodat
The compiler may hang when a for loop expanded in a generic instantiation has a range specified by a subtype indication with an explicit range that has a bound that is an attribute applied to a discriminant-dependent array component. The Parent field of the bound may not be set, which can lead to e

[Ada] Suppress_Initialization not respected for private subtypes

2019-08-12 Thread Pierre-Marie de Rodat
The compiler fails to suppress initialization on a variable of a subtype of a private type (such as System.Address) even though the subtype has aspect Suppress_Initialization. This can lead to errors on object declarations specified with Thread_Local_Storage when Initialize_Scalars is applied (as w

[Ada] Wrong initialization of Offset_To_Top in secondary DT

2019-08-13 Thread Pierre-Marie de Rodat
The compiler does not initialize well the runtime information required to perform at runtime interface conversions on derivations of tagged types that implement interfaces and have variable size components. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Javier Miranda gcc/ada/

[Ada] Fix spurious error on nested instantiation with inlining

2019-08-13 Thread Pierre-Marie de Rodat
This prevents the compiler from issuing a spurious error in a convoluted case where a child generic package declared in an enclosing parent generic package, which contains a second child generic package, contains an inlined subprogram and the second child generic package contains an instantiation o

[Ada] Complete the more extended AST traversal used in GNATprove

2019-08-13 Thread Pierre-Marie de Rodat
Following the work on the Ada 202X feature of iterated aggregates (AI12-061), Loop_Actions should have been listed as a semantic field of nodes of kind N_Iterated_Component_Association. Fix this as well as the new extended AST traversal which should traverse these fields. There is no impact on co

[Ada] Add ability to list compiler switches with gnatcmd

2019-08-13 Thread Pierre-Marie de Rodat
This patch adds a new switch (--help-ada) to gnatcmd for displaying all the availible build flags as well as fixing some minor differences in output between implicit and explicit help for gnatcmd (e.g. "gnat" vs "gnat --help"). $ gnat GNAT Pro 20.0w (19940713) Copyright 1996-2019, Free Software Fo

[Ada] Fix bogus style check failure with pragma Style_Checks (Off)

2019-08-13 Thread Pierre-Marie de Rodat
This fixes a bogus style check failure for long lines in rare cases where the compiler is invoked, with a -gnatyX switch where X is neither 'm' nor 'M', on a unit which contains "with" clauses for other units that contain a pragma Style_Checks (Off). Tested on x86_64-pc-linux-gnu, committed on tru

[Ada] Fix incorrect binding to MapViewOfFile in s-win32.ads

2019-08-13 Thread Pierre-Marie de Rodat
Despite the "dw" prefix on the name, the dwNumberOfBytesToMap argument to MapViewOfFile was changed from DWORD to SIZE_T when 64bit Windows came about. This change adjusts the binding we have for it in System.Win32 accordingly. For consistency with established practice, an s-win32 specific version

[Ada] Disable anonymous allocator warning for library-level objects

2019-08-13 Thread Pierre-Marie de Rodat
This patch modifies the behavior of anonymous allocator warnings so that they no longer get triggered in the case of an object declaration at library-level. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Justin Squirek gcc/ada/ * exp_ch4.adb (Expand_N_Allocator): Add co

[Ada] Do full name qualification of local exception names for LLVM

2019-08-13 Thread Pierre-Marie de Rodat
Exceptions declared within subprograms are associated with objects allocated statically (at the global level), and it's helpful for the LLVM compiler (and likely others, such as CCG) if the exception name is fully qualified, to avoid link name clashes (gcc-based GNAT has always "uniquified" these n

[Ada] Spurious error on nested instantiation

2019-08-13 Thread Pierre-Marie de Rodat
This fixes a spurious error given by the compiler for a call to a subprogram which is the formal subprogram parameter of a generic package, if the generic package is instantiated in the body of an enclosing generic package with two formal types and two formal subprogram parameter homonyms taking th

[Ada] Avoid crash in GNATprove due to inlining inside type

2019-08-13 Thread Pierre-Marie de Rodat
The special inlining for GNATprove should not inline calls inside record types, used for the constraints of components. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Yannick Moy gcc/ada/ * sem_res.adb (Resolve_Call): Do not inline ca

[Ada] Compiler may blow up on array aggregates whose size is very large

2019-08-13 Thread Pierre-Marie de Rodat
The compiler may crash when compiling array aggregates where the computation of the size produces a very large number that overflows (possibly producing a small result), such as with an aggregate of a type that is an array of arrays, where each array range has close to Integer'Last elements. That c

[Ada] Avoid spurious errors on dimensionality checking in GNATprove

2019-08-13 Thread Pierre-Marie de Rodat
Complete the partial treatment that was started in r273405. Instead of checking for the special case of nodes inside inlined bodies at the call site, check for this condition inside the top-level procedures called for dimensionality checking. There is no impact on compilation. Tested on x86_64-p

[Ada] Fix spurious instantiation error on private record type

2019-08-13 Thread Pierre-Marie de Rodat
This change was initially aimed at fixing a spurious instantiation error due to a disambiguation issue which happens when a generic unit with two formal type parameters is instantiated on a single actual type that is private. The compiler internally sets the Is_Generic_Actual_Type flag on the actu

[Ada] Small cleanup and improvement in inlining machinery

2019-08-13 Thread Pierre-Marie de Rodat
This is a small cleanup in the inlining machinery of the front-end dealing with back-end inlining. It should save a few cycles at -O0 by stopping it from doing useless work. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Eric Botcazou gcc/ada/ *

[Ada] Avoid crash in GNATprove_Mode on allocator inside type

2019-08-13 Thread Pierre-Marie de Rodat
In the special mode for GNATprove, subtypes should be declared for allocators when constraints are used. This was done previously but it does not work inside spec expressions, as the declaration is not inserted and analyzed in the AST in that case, leading to a later crash on an incomplete entity.

[Ada] Implement pragma Max_Entry_Queue_Length

2019-08-13 Thread Pierre-Marie de Rodat
This patch implements AI12-0164-1 for the aspect/pragma Max_Entry_Queue_Length. Previously, the GNAT specific pragma Max_Queue_Length fulfilled this role, but was not named to match the standard and thus was insufficent. -- Source -- -- pass.ads with System; package P

[Ada] Show Bit_Order and Scalar_Storage_Order in -gnatR4 output

2019-08-13 Thread Pierre-Marie de Rodat
This patch modifies the behavior of -gnatR4 so that representation information for bit and scalar storage order gets displayed in all cases and not just when defaults are overriden. -- Source -- -- pkg.ads package Pkg is type Root is tagged record Data0 : Integ

[Ada] Add conformance check on actual subp. in instance of child unit

2019-08-13 Thread Pierre-Marie de Rodat
This patch properly diagnoses a conformance error between a formal subprogram and the corresponding actual, when the instance is that of a child unit that is instantiated as a compilation unit. The error is normally suppressed on an instantiation nested within another generic, given that analysis o

[Ada] Build full derivation for private concurrent type

2019-08-13 Thread Pierre-Marie de Rodat
This extends the processing done for the derivation of private discriminated types to concurrent types, which is now required because this derivation is no longer redone when a subtype of the derived concurrent type is built. This increases the number of entities generated internally in the compil

[Ada] Do not remove side-effects in an others_clause with function calls

2019-08-13 Thread Pierre-Marie de Rodat
An aggregate can be handled by the backend if it consists of static constants of an elementary type, or null. If a component is a type conversion we must preanalyze and resolve it to determine whether the ultimate value is in one of these categories. Previously we did a full analysis and resolutio

[Ada] Legality rule on ancestors of type extensions in generic bodies

2019-08-13 Thread Pierre-Marie de Rodat
This patch adds an RM reference for the rule that in a generic body a type extension cannot have ancestors that are generic formal types. The patch also extends the check to interface progenitors that may appear in a derived type declaration or private extension declaration. Tested on x86_64-pc-li

[Ada] Wrong dispatching call in type with aspect Implicit_Dereference

2019-08-13 Thread Pierre-Marie de Rodat
When a record type with an an access to class-wide type discriminant has aspect Implicit_Dereference, and the discriminant is used as the controlling argument of a dispatching call, the compiler may generate wrong code to dispatch the call. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-0

[Ada] Illegal selection of first object in a task type's body not detected

2019-08-14 Thread Pierre-Marie de Rodat
The compiler was improperly allowing selection of an object declared within a task body when the prefix was of the task type, specifically in the case where the object was the very first declared in the body (selections of later body declarations were being flagged). The flag Is_Private_Op was onl

[Ada] Fix failing assertions on SPARK elaboration

2019-08-14 Thread Pierre-Marie de Rodat
Checking of SPARK elaboration rules may lead to assertion failures on a compiler built with assertions. Now fixed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-14 Yannick Moy gcc/ada/ * sem_disp.adb (Check_Dispatching_Operation): Updat

[Ada] Crash on precondition involving quantified expression

2019-08-14 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a precondition whose condition includes a quantified expression. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-14 Ed Schonberg gcc/ada/ * sem_util.adb (New_Copy_Tree, Visit_Entity): A quantified expression includes the implicit

[Ada] Fix discrepancy in mechanism tracking private and full views

2019-08-14 Thread Pierre-Marie de Rodat
This fixes a discrepancy in the mechanism tracking the private and full views of entities when entering and leaving scopes. This mechanism records private entities that are dependent on other private entities, so that the exchange done on entering and leaving scopes can be propagated. The propaga

[Ada] Spurious error in discriminated aggregate

2019-08-14 Thread Pierre-Marie de Rodat
This patch fixes a bug in which a spurious error is given on an aggregate of a type derived from a subtype with a constrained discriminant. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-14 Bob Duff gcc/ada/ * exp_aggr.adb (Init_Hidden_Discriminants): Avoid processing the

[Ada] Expose part of ownership checking for use in GNATprove

2019-08-14 Thread Pierre-Marie de Rodat
GNATprove needs to be able to call a subset of the ownership legality rules from marking. This is provided by a new function Sem_SPARK.Is_Legal. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-14 Yannick Moy gcc/ada/ * sem_spark.adb, sem_

[Ada] Equality for nonabstract type derived from interface treated as abstract

2019-08-14 Thread Pierre-Marie de Rodat
The compiler was creating an abstract function for the equality operation of a (nonlimited) interface type, and that could result in errors on generic instantiations that are passed nonabstract types derived from the interface type along with the derived type's inherited equality operation (complai

[Ada] Strengthen Locked flag

2019-08-14 Thread Pierre-Marie de Rodat
This patch strengthens the Locked flag, by Asserting that it is False on operations that might cause reallocation. No change in behavior (except in the presence of compiler bugs), so no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-14 Bob Duff gcc/ada/ * table.adb:

[Ada] Crash on quantified expression in disabled assertion

2019-08-14 Thread Pierre-Marie de Rodat
The defining identifier of a quantified expression may be the freeze point of its type. If the quantified expression appears in an assertion that is disavbled, the freeze node for that type may appear in a tree that will be discarded when the enclosing pragma is elaborated. To ensure that the free

<    15   16   17   18   19   20   21   22   23   24   >