[Ada] Spurious error in inlining for GNATprove on prefix call notation

2018-05-21 Thread Pierre-Marie de Rodat
During the special inlining done in GNATprove mode, a call in prefix notation leads to a spurious error. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-21 Yannick Moy gcc/ada/ * sem_ch6.adb (Analyze_Procedure_Call): Refine test to recognize prefix call n

[Ada] Robustify traceback caching for executable in current dir

2018-05-21 Thread Pierre-Marie de Rodat
Any program calling Gnat.Traceback.Symbolic.Enable_Cache for dwarf based symbolization fails with a segmentation violation when spawned with an inaccurate argv[0] such that it couldn't be found on PATH. argv[0] is most often found on PATH. One plausible case where it isn't is when argv[0] is a mer

[Ada] Spurious error on indexed call as prefix of a call

2018-05-21 Thread Pierre-Marie de Rodat
This patch refines the handling of the well-known syntactic ambiguity created by a function with defaulted parameters that returns an array, so that F (X) may designate a call to the function, or an indexing of a parameterless call. This patch handles the case where such a call is itself the prefix

[Ada] Use type conversion when inlining may trigger a run-time check

2018-05-21 Thread Pierre-Marie de Rodat
In the frontend inlining used in GNATprove, inlining of a return statement was using an unchecked type conversion, which could cause a necessary run-time check on the conversion to be skipped. Now fixed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05

[Ada] Placement of pragma Elaboration_Checks

2018-05-21 Thread Pierre-Marie de Rodat
This patch modifies the semantics of pragma Elaboration_Checks. The pragma was intended to be a configuration pragma, however its placement was never verified until now. The pragma may appear in the following contexts: * Configuration pragmas file * Prior to the context clauses of a compil

[Ada] Exit statement in loops over iterable objects

2018-05-21 Thread Pierre-Marie de Rodat
This patch fixes an omission in the expansion of loops over GNAT-specific iterable objects. If the source includes an explicit name for the loop, that name has to be preserved in the expanded code to allow exit statements to mention it. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-21

[Ada] Spurious error on early call region of tagged type

2018-05-21 Thread Pierre-Marie de Rodat
This patch corrects the part of the access-before-elaboration mechanism which ensures that the freeze node of a tagged type is within the early call region of all its overriding bodies to ignore predefined primitives. -- Source -- -- pack.ads package Pack with SPARK_Mo

[Ada] Error message on invalid conversion involving limited views

2018-05-21 Thread Pierre-Marie de Rodat
A type conversion may be illegal if the expression in the conversion has a limited view of a type. This patch expands the error report to indicate the presence of a limited view, and when the context is a package body it suggests the addition of a regular with-clause to make the full view available

[Ada] Aspects on stubs

2018-05-21 Thread Pierre-Marie de Rodat
This patch ensures that aspect specifications which appear on package, protected, and task body stubs are properly analyzed. -- Source -- -- pack.ads package Pack with SPARK_Mode, Abstract_State => State is - -- Refine

[Ada] Spurious warning on object declaration with address clause

2018-05-21 Thread Pierre-Marie de Rodat
The compiler warns on an object declaration with default initialization and an address clause, to indicate that the overlay implied by the address clause might affect a value elsewhere. The warning is suppressed if the type carries the Suppress_Initialization aspect. With this patch the compiler al

[Ada] Missing error on illegal categorization dependency

2018-05-22 Thread Pierre-Marie de Rodat
This patch modifies the analysis of subprogram declarations to ensure that an aspect which is converted into a categorization pragma is properly taken into account when verifying the dependencies of a subprogram unit. -- Source -- -- pack.ads package Pack is end Pack;

[Ada] Prevent caching of non-text symbols for symbolic tracebacks

2018-05-22 Thread Pierre-Marie de Rodat
We now only have the executable code section boundaries at hand, so can only infer offsets for symbols within those boundaries. Symbols outside of this region are non-text symbols, pointless for traceback symbolization anyway. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Olivier

[Ada] Adding support for Ada.Locales package

2018-05-22 Thread Pierre-Marie de Rodat
tat", "Tatar", + "tw", "twi", "Twi", + "ty", "tah", "Tahitian", + + "ug", "uig", "Uighur", + "uk", "ukr", "Ukrainian", + "ur", "urd", "

[Ada] No error on misplaced pragma Pure_Function

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby placement of the pragma/aspect Pure_Function was not verified to have been in the same declarative part as the function declaration incorrectly allowing it to appear after a function body or in a different region like a private section. Tested on x86_64-pc-linux-g

[Ada] Crash on pragma Compile_Time_Warning with declared string constant

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a pragma Compile_Time_Warning when its second argument is a reference to a constsant string (rather than a string literal or an expression that evaluates to a string literal). Compiling main.adb must yield: main.adb:5:33: warning: Good main.adb:6:33: war

[Ada] Spurious size error on fixed point type with aspect Small

2018-05-22 Thread Pierre-Marie de Rodat
This path fixes a spurious size error on a fixed point that carries an aspect specification for the 'Small of the type, when there is a subsequent derivation of that type before the type is frozen, the given 'Small is not not a power of two, and the bounds of the type require its full size, also gi

[Ada] Spurious visibility error on aspect in generic unit

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes a spurious visiblity error on an instantiation of a generic package that contains a type declaration with an aspect specification for an aspect that must be delayed (i.e. an aspect whose value may be specified at a later point). The package g.ads must compile quietly: with S

[Ada] Prohibit output dependency items on functions

2018-05-22 Thread Pierre-Marie de Rodat
This patch modifies the analysis of pragma [Refined_]Depends to emit an error when the pragma is asspciated with a [generic] function, and one of its clauses contains a non-null, non-'Result output item. -- Source -- -- pack.ads package Pack with SPARK_Mode is Obj_1

[Ada] Allow attribute 'Valid_Scalars on private types

2018-05-22 Thread Pierre-Marie de Rodat
This patch modifies the analysis and expansion of attribute 'Valid_Scalars. It is now possible to specify the attribute on a prefix of an untagged private type. -- Source -- -- gnat.adc pragma Initialize_Scalars; -- pack1.ads package Pack1 is type Acc_1 is priva

[Ada] Spurious visibility error in a nested instance with formal package

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes a spurious visibility error with a nested instance of a generic unit with a formal package, when the actual for it is a formal package PA of an enclosing generic, and there are subsequent uses of the formals of PA in that generic unit. Tested on x86_64-pc-linux-gnu, committed on t

[Ada] Crash with private types and renamed discriminants

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on an object declaration whose type is a private type with discriminants, and whose full view is a derived type that renames some discriminant of its parent. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Ed Schonberg gcc/ada/ * sem_ch3

[Ada] Fix compiler abort on invalid discriminant constraint

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a discriminant constraint when the constraint is a subtype indication. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Patrick Bernardi gcc/ada/ * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the user tries

[Ada] Ada2020: Reduction expressions

2018-05-22 Thread Pierre-Marie de Rodat
This patch dismantles the prototype implementation of the first proposal for Reduction expressions, one of the important potentially parallel constructs for Ada2020. The ARG is going in a different direction with a simpler syntax. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Ed S

[Ada] In-place initialization for Initialize_Scalars

2018-05-22 Thread Pierre-Marie de Rodat
This patch cleans up the implementation of routine Get_Simple_Init_Val. It also eliminates potentially large and unnecessary tree replications in the context of object default initialization. No change in behavior, no test needed. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Hri

[Ada] Better error message on illegal 'Access on formal subprogram

2018-05-22 Thread Pierre-Marie de Rodat
This patch improves on the error message for an attempt to apply 'Access to a formal subprogram. It also applies the check to a renaming of a formal subprogram. Compiling p.adb must yield: p.adb:15:18: not subtype conformant with declaration at line 2 p.adb:15:18: formal subprograms are not subty

[Ada] Fix the signal trampoline on QNX

2018-05-22 Thread Pierre-Marie de Rodat
The trampoline now properly restores the link register as well as the stack pointer. As a minor optimisation, now only callee-saved registers are restored: the scratch registers don't need that. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Jerome Lambourg gcc/ada/ * s

[Ada] Disable name generation for External_Tag and Expanded_Name

2018-05-22 Thread Pierre-Marie de Rodat
In order to avoid exposing internal names of tagged types in the binary code generated by the compiler this enhancement facilitates initializes the External_Tag of a tagged type with an empty string when pragma No_Tagged_Streams is applicable to the tagged type, and facilitates initializes its Expa

[Ada] In-place initialization for Initialize_Scalars

2018-05-22 Thread Pierre-Marie de Rodat
This patch optimizes the initialization and allocation of scalar array objects when pragma Initialize_Scalars is in effect. The patch also extends the syntax and semantics of pragma Initialize_Scalars to allow for the specification of invalid values pertaining to families of scalar types. The new s

[Ada] Fix retrieval of number of CPUs on QNX

2018-05-22 Thread Pierre-Marie de Rodat
Although the sysconf SC_NPROCESSORS_ONLN is also defined by the API, the only documented way to retrieve the number of CPUs is by using the syspage. This also better organise the QNX-specific macros in adaint.c Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Jerome Lambourg gcc/

[Ada] Crash on partial initialization of controlled component

2018-05-22 Thread Pierre-Marie de Rodat
This patch modifies the late expansion of record aggregates to ensure that the generated code which handles a controlled component initialized by a function call is inserted in line with the rest of the initialization code, rather than before the record aggregate. This way the function call has pro

[Ada] Missing warning for unreferenced formals in expression functions

2018-05-22 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby the compiler failed to properly warn against unreferenced formal parameters when analyzing expression functions. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-22 Justin Squirek gcc/ada/ * sem_ch6.adb (Analyze_Expression_Function): Propaga

[Ada] Fix Reraise_Occurrence of Foreign_Exception

2018-05-22 Thread Pierre-Marie de Rodat
In a sequence like (d)(c) (b) (a) c++ raises <-- Ada calls c++, <-- c++ call Ada <-- Ada calls exception others handler and handles c++ gets foreignc++ exception exception and re-raises t

[Ada] Initialize_Scalars optimization causes spurious runtime check failure

2018-05-23 Thread Pierre-Marie de Rodat
This patch suppresses the optimization of scalar arrays when pragma Initialize_Scalars is in effect if the component type is subject to predicates. Since the scalar array is initialized with invalid values, these values may violate the predicate or a validity check within the predicate. --

[Ada] Suppression of elaboration-related warnings

2018-05-23 Thread Pierre-Marie de Rodat
This patch modifies the effects of pragma Warnings (Off, ...) to suppress elaboration warnings related to an entity. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Hristian Kirtchev gcc/ada/ * einfo.adb (Is_Elaboration_Checks_OK_Id): Use predicate Is_Elaboration

[Ada] Compiler fails to reject illegal store of anonymous_access_to_subprogram

2018-05-23 Thread Pierre-Marie de Rodat
GNAT properly rejects an attempt to assign an access_to_subprogram formal to a local variable, according to accessibiiity rules. This patch forces the same behavior on the use of such a formal in an object declaration. Compiling store_anon.adb must yield: store_anon.adb:7:35: illegal attempt to

[Ada] Crash on predicate involving qualified expression in instance

2018-05-23 Thread Pierre-Marie de Rodat
This patch inhibits the generation of freeze nodes when pre-analyzing the domain of iteration of an Ada2012 loop that appears as a quantified expression in a predicate for an array type. This prevents a back-end abort on an invisible freeze node that would otherwise appear in an unexpanded code seq

[Ada] Suppression of elaboration-related warnings

2018-05-23 Thread Pierre-Marie de Rodat
This patch updates the documentation section on suppressing elaboration warnings. No change in behavior, no need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Hristian Kirtchev gcc/ada/ * sem_elab.adb: Update the section on suppressing elaboration warnings.

[Ada] Suppression of elaboration-related warnings

2018-05-23 Thread Pierre-Marie de Rodat
This patch changes the behavior of elaboration-related warnings as follows: * If a scenario or a target has [elaboration] warnings suppressed, then any further elaboration-related warnings along the paths rooted at the scenario are also suppressed. * Elaboration-related warnings r

[Ada] Build-in-place aggregates and Address clauses

2018-05-23 Thread Pierre-Marie de Rodat
This patch fixes a bug in which if a limited volatile variable with an Address aspect is initialized with a build-in-place aggregate containing build-in-place function calls, the compiler can crash. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Bob Duff gcc/ada/ * free

[Ada] Suspension and elaboration warnings/checks

2018-05-23 Thread Pierre-Marie de Rodat
This patch modifies the static elaboration model to stop the inspection of a task body when it contains a synchronous suspension call and restriction No_Entry_Calls_In_Elaboration_Code or switch -gnatd_s is in effect. -- Source -- -- suspension.ads package Suspension i

[Ada] Fix of some permission rules of pointers in SPARK

2018-05-23 Thread Pierre-Marie de Rodat
This commit fixes bugs in the code that implements the rules for safe pointers in SPARK. This only affects SPARK tools, not compilation. * Global variables should be handled differently compared to parameters. The whole tree of an in global variable has the permission Read-Only. In contr

[Ada] Fix implementation of utility for finding enclosing declaration

2018-05-23 Thread Pierre-Marie de Rodat
This utility is used in GNATprove to find when a node is inside a named number declaration, and this case was not properly handled. Now fixed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Yannick Moy gcc/ada/ * sem_util.adb (Enclosin

[Ada] Missing legality check on iterator over formal container

2018-05-23 Thread Pierre-Marie de Rodat
This patch adds a check on an iterator over a GNAT-specific formal container, when the iterator specification includes a subtype indication that must be compatible with the element type of the container. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Ed Schonberg gcc/ada/

[Ada] Add a Is_Foreign_Exception predicate to GNAT.Exception_Actions

2018-05-23 Thread Pierre-Marie de Rodat
Useful to check if an occurrence caught by a "when others" choice originates from a foreign language, e.g. C++. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Olivier Hainque gcc/ada/ * libgnat/g-excact.ads (Is_Foreign_Exception): New predicate. * libgnat/g-exca

[Ada] Clarify meaning of local pragma Warnings Off without On

2018-05-23 Thread Pierre-Marie de Rodat
A local use of pragma Warnings Off to suppress specific messages, when not followed by a matching pragma Warnings On, extends until the end of the file. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Yannick Moy gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst:

[Ada] Implementation of AI12-0131: legality of class-wide precondition

2018-05-23 Thread Pierre-Marie de Rodat
This patch refines the legality check on a class-wide precondition on a type extension when ancestor does not have a class-wide precondition. Previously the compiler accepted such a precondition when the ancestor had a class-wide postcondition. Compiling pck.ads must yield: pck.ads:7:04: illega

[Ada] gnatbind: do not list No_Implementation_Restrictions

2018-05-23 Thread Pierre-Marie de Rodat
When the gnatbind -r switch is used, do not list No_Implementation_Restrictions, because after using the new restriction list, No_Implementation_Restrictions will cause an error. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Bob Duff gcc/ada/ * gnatbind.adb (List_Appli

[Ada] Vectors: spurious error in -gnatwE mode

2018-05-23 Thread Pierre-Marie de Rodat
This patch fixes a bug in which if Ada.Containers.Vectors is instantiated with an Index_Type such that Index_Type'Base'Last is less than Count_Type'Last, and the -gnatwE switch is used, the compiler gives spurious error messages. The following test should compile quietly with -gnatwE: gnatmake sh

[Ada] Crash processing Valid_Scalars whose evaluation is always true

2018-05-23 Thread Pierre-Marie de Rodat
The compiler blows up generating code associated with occurrences of attribute Valid_Scalars whose evaluation is always true. After this patch the following test compiles fine. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Javier Miranda gcc/ada/ * sem_attr.adb (Valid_

[Ada] Spurious Storage_Error on imported array

2018-05-23 Thread Pierre-Marie de Rodat
This patch moves the check which verifies that a large modular array is created from expansion to freezing in order to take interfacing pragmas in account. The check is no longer performed on imported objects because no object is created in that case. Tested on x86_64-pc-linux-gnu, committed on tr

[Ada] Spurious error on instantiation with type with unknown discriminants

2018-05-23 Thread Pierre-Marie de Rodat
This patch fixes a spurious error when instantiating an indefinite container with a private type with unknown discriminants, when its full view is an unconstrained array type. It also cleans up the inheritance of dynamic predicates inherited by anonymous subtypes of array types. Tested on x86_64-p

[Ada] Fix computation of handle/pid lists in win32_wait

2018-05-23 Thread Pierre-Marie de Rodat
An obvious mistake due to missing parentheses was not properly computing the size of the handle and pid list passed to WaitForMultipleObjects(). This resulted in a memory corruption. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-23 Pascal Obry gcc/ada/ * adaint.c (win32_w

[Ada] Spurious error on imported subprogram with precondition

2018-05-24 Thread Pierre-Marie de Rodat
This patch modifies the generation of wrappers for imported subprograms which are subject to contracts. In the case of an imported function, the original function is relocated within the wrapper, and the wrapper simply invokes the imported subprogram, returning its value. When the result type of th

[Ada] Fix references to Backend_Layout configuration parameter

2018-05-24 Thread Pierre-Marie de Rodat
Apparently the Backend_Layout target configuration parameter was renamed to Frontend_Layout a long time ago (and their meanings are opposite). However, some comments were still referencing the no longer existing Backend_Layout. This patch fixes such references. No test provided, because only comme

[Ada] Spurious error on private task derivation

2018-05-24 Thread Pierre-Marie de Rodat
The compiler reports a spurious error notifying a missing constraint in the declaration of a private type with discriminants whose full view is a derivation of a task type. After this patch the following test compiles without errors. package Types1 is type Parent (Discr1 : Boolean) is limited

[Ada] Crash on compilation unit instance

2018-05-24 Thread Pierre-Marie de Rodat
Do not generate a variable marker for a reference which appears within the formal part of an instantiation which acts as a compilation unit because there is no suitable insertion context. -- Source -- -- gnat.adc pragma SPARK_Mode (On); -- gen.ads generic Val_1 :

[Ada] Expansion of discrete choices

2018-05-24 Thread Pierre-Marie de Rodat
This patch does some minor bookkeeping to avoid a potential double expansion of discrete choices where at least one of them is a subtype with predicates. No change in behavior, no need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24 Hristian Kirtchev gcc/ada/

[Ada] Fix inconsistent documentation for the Contract_Cases pragma

2018-05-24 Thread Pierre-Marie de Rodat
This patch propagates the renaming from "condition" to "case guard" in the contract grammar to the paragraphs that describe the pragma semantics. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24 Piotr Trojanek gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Con

[Ada] Spurious error on pragma Independent_Components

2018-05-24 Thread Pierre-Marie de Rodat
This patch modifies the analysis of pragma Independent_Components to account for a side effect from handling of self-referential records which render the pragma illegal. -- Source -- -- pack.ads package Pack is type OK is record Comp_1 : Integer; Comp_2

[Ada] Fix crash on formal containers

2018-05-24 Thread Pierre-Marie de Rodat
This patch modifies several mechanisms in the compiler: 1) The handling of Ghost regions now records the start of the outermost ignored Ghost region which is currently in effect. 2) Generation of freeze actions for an arbitrary entity now inserts the actions prior to the start of the outerm

[Ada] Memory leak mixing limited and nonlimited functions

2018-05-24 Thread Pierre-Marie de Rodat
This patch fixes a memory leak. If a build-in-place function with a result whose size is not known at the call site is called, and that function calls a non-build-in-place function that allocates on the secondary stack, the secondary stack was not necessarily cleaned up, which caused a memory leak.

[Ada] Crash on function in Ghost subunit

2018-05-24 Thread Pierre-Marie de Rodat
This patch modifies the creation of class-wide subtypes to preserve vital attributes related to Ghost code. The subtype is created by copying the contents of a class-wide type into a newly created itype. When the itype is created within a Ghost region, the act of copying destroys Ghost code related

[Ada] Ineffective use warning is suppressed when performing verification

2018-05-24 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby the compiler incorrectly marked use clauses as effective due to code generated for verification referencing certain types leading to missing use clause warnings. No reasonably small testcase available. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24

[Ada] Add warning on redundant others_clause in array aggregate

2018-05-24 Thread Pierre-Marie de Rodat
This patch adds a warning on a redundant others_clause in an array aggregate when all index positions are already specified in previous positional or named associations. The warning is emitted when Warn_On_Redundant_Constructs is enabled. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-

[Ada] Spurious error due to lingering limited view

2018-05-24 Thread Pierre-Marie de Rodat
This patch modifies the mechanism which manages [private] with clauses to uninstall a limited with clause if a non-limited with clause is given for the same package. The management of with clauses already prevents the installation of a limited with clause if the related package is already withed t

[Ada] Crash on return of raise expression

2018-05-24 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby the compiler regarded assignments to limited that consisted of raise expressions to be a compile-time error during expansion. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24 Justin Squirek gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declarat

[Ada] Infinite loop in the compiler when warning on redundant constructs

2018-05-24 Thread Pierre-Marie de Rodat
This patch fixes an infinite loop in the compiler when warnings on redundant constructs are enabled (-gnatwr) and the constructs are use_type clauses that appear (redundantly) in a parent unit and a child unit. The following command: gcc -c -gnatwr root-child.ads must yield: root-child.ad

[Ada] Quadratic compile time with tagged types

2018-05-24 Thread Pierre-Marie de Rodat
This patch is an incremental commit which focuses on the optimization of entity chain navigation by adding an additional field (Prev_Entity) to all nodes in order to greaty speed up compilation of sources making heavy use of tagged derivations by effectly making the entity chain from a singly-linke

[Ada] Missing error on illegal access to discriminant

2018-05-24 Thread Pierre-Marie de Rodat
The compiler does not report an error on the illegal access to a renamed discriminant when the actual object is a parameter of a subprogram. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24 Javier Miranda gcc/ada/ * sem_ch3.adb (Is_Visible_Component): For untagged types a

[Ada] Improve GNATprove messages on unproved checks

2018-05-24 Thread Pierre-Marie de Rodat
GNATprove messages may point out to part of an assertion as not being proved, and in such a case it displays the sub-expression. This code relies on Pprint.Expression_Image, which is improved here to display better some kinds of expressions. There is no impact on compilation. Tested on x86_64-pc-

[Ada] Wrong renaming of variant record equality

2018-05-24 Thread Pierre-Marie de Rodat
For a renaming of the equality operator of a variant record the compiler erroneously generates code that compares all the record component (thus computing wrong results). After this patch the following test provides the correct results. package Types is type Data (Bool : Boolean := False) is r

[Ada] Simplify routines with a local Result variable

2018-05-24 Thread Pierre-Marie de Rodat
Local variable Result that is modified inside IF statements makes a seemingly trivial code slightly hard to understand. This patch rewrites such a pattern. Semantics unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-24 Piotr Trojanek gcc/ada/ * sem_elab.adb (Non_

[Ada] Fix irregular output with -gnatR3

2018-05-24 Thread Pierre-Marie de Rodat
This fixes a long-standing quirk present in the layout information for record types displayed by the -gnatR3 switch: when a component has a variable (starting) position, its corresponding line in the output has an irregular and awkward format. After this change, the format is the same as in all th

[Ada] Detect misplaced assertions between loop invariants

2018-05-25 Thread Pierre-Marie de Rodat
Loop invariants and loop variants should all be colocated, as defined in SPARK RM 5.5.3(8). The code checking that rule was incorrectly accepting pragma Assert between two loop invariants. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Yannick Moy gcc/ada/ *

[Ada] Compiler loop on expression function and predicate in generic unit

2018-05-25 Thread Pierre-Marie de Rodat
This patch fixes an infinite loop in the compiler when analyzing an expression function whose expression mentions a subtype with a static predicate, and the context is a generic unit. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Ed Schonberg gcc/ada/ * sem_ch13.adb (B

[Ada] Support for C99 and C++ standard boolean types

2018-05-25 Thread Pierre-Marie de Rodat
This change the type Interfaces.C.Extensions.bool to be fully compatible with the C99 and C++ standard boolean types by making it a fully-fledged boolean type with convention C. The following C+Ada program must compile quietly in LTO mode: bool b; struct S {}; bool foo (struct S *s) { return tr

[Ada] Unbounded strings: inline Initialize and Adjust

2018-05-25 Thread Pierre-Marie de Rodat
Procedures Initialize and Adjust in the Ada.[Wide_[Wide_]]Strings.Unbounded package are now inlined for nondispatching calls. No test available (efficiency issue only). Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Bob Duff gcc/ada/ * libgnat/a-strunb__shared.ads, libg

[Ada] Fix handling of Loop_Entry for CodePeer/SPARK

2018-05-25 Thread Pierre-Marie de Rodat
When the applicable Assertion_Policy is Ignore for a pragma containing an occurrence of attribute Loop_Entry, CodePeer and SPARK should still be able to analyze the corresponding pragma. GNAT frontend was wrongly translating X'Loop_Entry as X in the AST, as a side-effect of an optimization only val

[Ada] Make Max_Sensible_Delay uniform across all Posix targets

2018-05-25 Thread Pierre-Marie de Rodat
For instance: 6 months where Duration is 64bits. Heretofore LynxOS was unique in having an approximately 12 days max delay. By experimentation the actual maximum was determined and all relevant delay and sleep procedures rewritten to incrementally wait if necessary. Tested on x86_64-pc-linux-gnu,

[Ada] Checks on instantiations with formal derived types with interfaces

2018-05-25 Thread Pierre-Marie de Rodat
This patch implements the rule stated in RM 12.5.5 : the actual shall be a descendant of very progenitor of the formal type. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Ed Schonberg gcc/ada/ * sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual

[Ada] Spurious secondary stack depletion

2018-05-25 Thread Pierre-Marie de Rodat
This patch reimplements the secondary stack allocation logic to eliminate an issue which causes the memory index to overflow while the stack itself uses very little memory, thus causing a spurious Storage_Error. The issue in details: The total amount of memory that the secondary stack can accomod

[Ada] Rewrite Iterate_Call_Parameters in more assertive style

2018-05-25 Thread Pierre-Marie de Rodat
The formal and actual parameters in a subprogram call must match each other. This is now checked with assertion (so that we can detect possible mistakes), while the production builds have less work to do. Semantics unchanged. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Piotr Tro

[Ada] Disable the creation of the main task secondary stack by the binder

2018-05-25 Thread Pierre-Marie de Rodat
Users can now specify that the binder should not create a secondary stack for the main (environment) task through the binder switch -Q0. This is useful for ZFP runtime users who allocate secondary stacks for their application themselves. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-2

[Ada] Crash on classwide precondition on subprogram with stub

2018-05-25 Thread Pierre-Marie de Rodat
This patch allows the compiler to handle properly a classwide precondition on a primitive operation whose body is a stub and a separate subunit. Executing: gnatmake -gnata -q check ./check must yield: precondition violated with Text_IO; with Msg_Data_Block_Decoder; use Msg_Data_B

[Ada] Membership test of class-wide interface

2018-05-25 Thread Pierre-Marie de Rodat
The compiler rejects the use of a membership test when the left operand is a class-wide interface type object and the right operand is not a class-wide type. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Javier Miranda gcc/ada/ * sem_res.adb (Resolve_Membership_Op): Al

[Ada] Spurious range check with Initialize_Scalars

2018-05-25 Thread Pierre-Marie de Rodat
This patch modifies the expansion of default-initialized array objects when pragma Initialize_Scalars or Normalize_Scalars is in effect to suppress the generation of checks on the constructed in-place aggregate. The aggregate intentionally contains invalid values which may not necessarily fit the c

[Ada] Spurious error on fixed-point operation whose operands are expressions

2018-05-25 Thread Pierre-Marie de Rodat
This patch fixes a spurious error in a fixed-point operand of a multiplying operator M when the operand is an adding operation and the context imposes a different fixed-point type to the result of M. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Ed Schonberg gcc/ada/ *

[Ada] Improve performance of conversion from String to Long_Float

2018-05-25 Thread Pierre-Marie de Rodat
Once it is sure that the result will be infinity, stop computation and return the result. This ensure that the function call duration is bounded. Before that change on some cases the computation was taking more than a few seconds. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Nico

[Ada] Remove 2GB secondary stack limit for 64-bit processors

2018-05-25 Thread Pierre-Marie de Rodat
This patch removes the restriction introduced recently that limited the size of the secondary stack to 2GB. The size of the secondary stack is now limited to half of the size of the memory address space for the target. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-25 Patrick Bernardi

[PATCH] Enhance array types debug info. for Ada

2014-09-03 Thread Pierre-Marie de Rodat
es however). Ok for trunk? Thank you very much for reading until this point and thank you in advance for your review! ;-) -- Pierre-Marie de Rodat >From 15f8a12782cfcb084205c751d8c37c7a360bea2f Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 3 Sep 2014 09:46:17 +0200 Subject

[wwwdocs] Update sources trees handling in simtest-howto.html

2014-09-08 Thread Pierre-Marie de Rodat
io -pdlm ../combined && cd .. < cd gcc && find . -print | cpio -pdlmu ../combined && cd .. --- > cd src && find . -print | cpio -pdlm ../combined && cd .. > cd binutils-gdb && find . -print | cpio -pdlmu ../combined && cd .. > cd gcc && find . -print | cpio -pdlmu ../combined && cd .. -- Pierre-Marie de Rodat

Re: [wwwdocs] Update sources trees handling in simtest-howto.html

2014-09-08 Thread Pierre-Marie de Rodat
On 09/08/2014 05:04 PM, Pierre-Marie de Rodat wrote: It updates statements and shell commands to get/update/combine Binutils sources, which are now managed under a Git repository. Here is an update: Tristan pointed out on the other thread that the code for the simulators (formerly in src/sim

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

2014-10-07 Thread Pierre-Marie de Rodat
s are concerned, PLACEHOLDE_EXPR nodes are used only in GNAT, but it seems to me they describe the best what object the bound/stride/allocated/associated expressions (self-)reference. I have attached to this mail the 3 patches that are updated thanks to your (Jakub and Jason's) comments and

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

2014-10-07 Thread Pierre-Marie de Rodat
dates patches will follow... Thank you very much for your review! :-) -- Pierre-Marie de Rodat

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

2014-10-08 Thread Pierre-Marie de Rodat
e, there. So I finally leveraged this new composite argument to re-introduce the base_decl mechanism. DEBUG_EXPR_DECL is back in the Fortran front-end. ;-) Now, the same example keeps the same debugging information. The latest patches bootstrapped well and passed successfully the GCC testsuite on

[PING] Enhance array types debug info. for Ada

2014-10-22 Thread Pierre-Marie de Rodat
Hello, On 10/08/2014 09:05 PM, Pierre-Marie de Rodat wrote: The latest patches bootstrapped well and passed successfully the GCC testsuite on x86_64-pc-linux-gnu. Ping for https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00694.html Thanks in advance for you feedback! -- Pierre-Marie de Rodat

[PATCH] Spurious .s with -fdump-ada-spec

2014-06-04 Thread Pierre-Marie de Rodat
quot;dg-do assemble" instead of "dg-do compile". Many thanks in advance for your comments! 2014-06-02 Eric Botcazou Pierre-Marie de Rodat gcc/ * gcc.dg/dump-ada-spec/dump-ada-spec.exp: New. * gcc.dg/dump-ada-spec-1.c: Move to dump-ada-spec. *

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

2014-11-26 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

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

2014-12-01 Thread Pierre-Marie de Rodat
ata (i.e. SLEB128) instead of as DW_FORM_data1/2/4/8. This is a clear win for negative ones. I attached the only updated patch. The new patch set bootstrapped well and was successfully regtested on x86_64-linux. Thank you, -- Pierre-Marie de Rodat >From 4a8fe9204873864fd7ac898622d09a1d

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

2014-12-01 Thread Pierre-Marie de Rodat
is not acceptable: should we add a kludge in add_scalar_info in order to force unsignedness when generating debugging information for Fortran? -- Pierre-Marie de Rodat

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