[Ada] Compiler crash on function with 'in out' parameter

2017-04-25 Thread Arnaud Charlet
This patch fixes the following bug: If a function returns an unconstrained array whose component type is nonlimited controlled, and the function has an 'out' or 'in out' parameter, calls to that function can cause the compiler to crash. The following test must compile quietly. with

[Ada] Failure to detect illegal pragma No_Return

2017-04-25 Thread Arnaud Charlet
A pragma No_Return that applies to a procedure body is illegal. This patch fixes a bug that caused the compiler to fail to give an error. The following test should get an error: no_return.adb:6:04: representation item appears too late package No_Return is procedure P; end No_Return; package

[Ada] New warning on late dispatching primitives

2017-04-25 Thread Arnaud Charlet
Ada allows adding visible operations to a tagged type after deriving a private extension from it, which leads to confusing specifications on which declarations of public primitives of different types are mixed. This patch adds a new warning (enabled by means of -gnatw.j or -gnatwa) that warns on

[Ada] Missing error on illegal object.operation call

2017-04-25 Thread Arnaud Charlet
This patch modifies the mechanism which determines whether A.B denotes an object.operation call to work with the base type when the candidate type is a private extension. -- Source -- -- base.ads package Base is type A is tagged private; private type A is tagged

[Ada] Use of convention aspect Stdcall on a record component.

2017-04-25 Thread Arnaud Charlet
This patch fixes a spurious error on a record component whose type is an anonymous access to subprogram, when the component carries the Windows convention Stdcall. The following must compile quietly: --- package P is type T is record AF : access function (i:Integer) return integer

[Ada] Better range checking in GNATprove mode for float-to-int conversions

2017-04-25 Thread Arnaud Charlet
Range checks are now optimized away on float-to-int conversions when bound analysis can determine that the value is always in range. This is only possible in GNATprove mode, where NaN and infinite values are ruled out by the analysis. Also improve the computation of bounds for expressions that

[Ada] Improve computation of real bounds of type conversion expressions

2017-04-25 Thread Arnaud Charlet
Function Determine_Range_R is used in GNATprove to compute the maximal bounds of floating-point expressions. This computation now also deals with type conversion expressions, for conversions from integer to float. This allows to prove more checks (range and overflow) in GNATprove with a simple

[Ada] Validity checks and volatility

2017-04-25 Thread Arnaud Charlet
This patch partially reimplements validity checks to prevent multiple reads or copies of volatile expressions. This is achieved by first capturing the value of a volatile object into a variable (rather than a constant). The variable is then tested for validity (rather than the object again) and

[Ada] Legality rules on class-wide preconditions of overriding operations.

2017-04-25 Thread Arnaud Charlet
AI12-0131, part of the Ada2012 Corrigendum, places restrictions on class-wide preconditions of overriding operations, to prevent anomalies that would violate LSP if an overriding operation could declare such a precondition without an acestor of the operation having such a precondition to override.

[Ada] for CodePeer, omit Finalize_Address routines

2017-04-25 Thread Arnaud Charlet
Calls to Finalize_Address routines were already being omitted for CodePeer. If we are never going to call them, then we also shouldn't generate them. This change has no user-visible effect except when Gnat2scil is running. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Steve

[Ada] Use type clause in parent of a generic package

2017-04-25 Thread Arnaud Charlet
This patch fixes a bug in the handling of use_type_clauses If a use_type_clause "use type X;" appears in the parent of a generic child package, and "use type X;" also appears before an instantiation of that generic child package, the second "use type X;" is ineffective; the primitive operators of

[Ada] For CodePeer, omit some tag checks which confuse gnat2scil

2017-04-25 Thread Arnaud Charlet
CodePeer does not do anything useful with the various components of the record type Ada.Tags.Type_Specific_Data. Suppress generation of some checks which reference these components in cases where these checks cause CodePeer to generate unwanted messages. This change has no user-visible effect

[Ada] Wrong casing of restriction and check names

2017-04-25 Thread Arnaud Charlet
Fixes bugs in which the wrong casing was used for restriction names in pragmas Restrictions and Restriction_Warnings, and check names in pragma Check. No test is available -- too complicated to make it fail. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Bob Duff

[Ada] Use out-of-line string concatenation at library level

2017-04-25 Thread Arnaud Charlet
String concatenation can be implemented either in-line or out-of-line by the compiler, depending on the optimization level and other factors. But doing in-line concatenation at library level is undesirable in general and the compiler already avoids it for simple declarations: S : String := S1

[Ada] Static intialization with pragma Linker_Section

2017-04-25 Thread Arnaud Charlet
This patch is an improvement that causes an array object that has a pragma Linker_Section with a compile-time-known initial value to be statically initialized in place in the appropriate section. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Bob Duff

[Ada] Specifying Address clause on controlled objects

2017-04-25 Thread Arnaud Charlet
This patch removes the restriction on attribute definition clause 'Address which prevented it from being used with controlled objects. The restriction was a legacy left over from the previous controlled type implementation where each controlled type had hidden components that should not be

[Ada] Reduce rounding overhead in sin/cos/tan functions on x86

2017-04-25 Thread Arnaud Charlet
The trigonometric functions of children of Ada.Numerics are implemented by inline assembly statements on the x86 architecture, and for sin/cos/tan a special range reduction algorithm is used to avoid a loss of accuracy in range reduction implemented in hardware on x86 processors. This algorithm

[Ada] Visibility problem using Import aspect

2017-04-25 Thread Arnaud Charlet
This patch corrects an issue whereby an import aspect used within a generic package would fail to resolve. By analyzing the expresions within the aspect's arguments (a.k.a "interfacing" aspects) in addition to the generated pragma's arguments the generic template gets properly resolved names for

[Ada] New pragma No_Heap_Finalization

2017-04-25 Thread Arnaud Charlet
This patch introduces support for pragma No_Heap_Finalization which has the following syntax and semantics: pragma No_Heap_Finalization [ (first_subtype_LOCAL_NAME) ]; Pragma `No_Heap_Finalization` may be used as a configuration pragma or as a type-specific pragma. In its configuration form,

[Ada] Spurious compile failure with nested packages

2017-04-25 Thread Arnaud Charlet
This patch adds a predicate to verify that entities within an inner package do not rely on library unit level private types in cases where the full view of said private types are unseen. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Justin Squirek

[Ada] Spurious error on call to protected op. of same type as current instance.

2017-04-25 Thread Arnaud Charlet
If the prefix of a selected component denotes a synchronized object the selected component is part of an external call (or requeue) that can only access public operations of the object. The previous check on this construct was too restrictive, and did not allow public protected operations, only

[Ada] Missing error on illegal reference to Part_Of constituent

2017-04-25 Thread Arnaud Charlet
This patch corrects the mechanism which verifies the legality of references to variables and constants acting as Part_Of constituents of single protected or task types to continue examining the context of the reference when it appears in an expression function. -- Source --

[Ada] Crash on illegal specification for a configuration file.

2017-04-25 Thread Arnaud Charlet
The -gnatec switch is used to specify configuration files containing that contain configuration pragmas. With This patch the compiler rejects properly a name for a configuration file that designates a directory rather than crashing. Executing gcc -c pkg.ads -gnatec=. must yield: gnat1:

[Ada] Ignore_Pragma causes errors in the run-time system

2017-04-25 Thread Arnaud Charlet
This patch fixes a bug in which pragma Ignore_Pragma can cause errors in the run-time system, if it applies to pragmas actually used in the run-time system. Pragma Ignore_Pragma no longer applies to pragmas in the run-time system. The following test should compile quietly. -- gnat.adc pragma

[Ada] pragma Ignore_Pragma(Interface); is illegal

2017-04-25 Thread Arnaud Charlet
This patch fixes a bug in which pragma Ignore_Pragma(Interface); is illegal, except in Ada 83 mode. It should be legal in all modes. The following test should compile quietly. -- gnat.adc pragma Ignore_Pragma(Interface); -- legal_interface.ads package Legal_Interface is procedure

[Ada] Support for discriminants in pragma Default_Initial_Condition

2017-04-25 Thread Arnaud Charlet
This patch augments the existing support for tagged discriminants in assertion expressions such as those of pragma Default_Initial_Condition or Type_Invariant 'Class by adding support for ancestor subtypes. -- Source -- -- tester.ads package Tester is type Type_Id

[Ada] Spurious compile failure with nested packages

2017-04-25 Thread Arnaud Charlet
This patch adds another condition to an edge case used to delay expression function freezing (P804-015). The offending package is within the body of a library-level unit where this edge-case does not apply. By adding a condition that only delays freezing of expression functions if we are in a

[Ada] Remove uses of global variables from Sem_Prag

2017-04-25 Thread Arnaud Charlet
This patch cleans up some uses of global variables in Sem_Prag. No change in behavior; no test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Bob Duff * sem_prag.adb: Remove suspicious uses of Name_Buf. * stringt.ads, stringt.adb,

[Ada] Implementation of AI12-0125, use of @ as abbreviation for LHS.

2017-04-25 Thread Arnaud Charlet
With this patch the compiler now handles properly the use of @ as a prefix of a reference to a discriminated record component and to its bounds. The following must compile quietly in gnat2020 mode: --- procedure Discrs is begin declare -- Discrim-dependent subtypes subtype Index is

[Ada] Support for discriminants in pragma Default_Initial_Condition

2017-04-25 Thread Arnaud Charlet
This patch adds support for tagged discriminants in assertion expressions such as those of pragma Default_Initial_Condition or Type_Invariant'Class. In these contexts, tagged discriminants behave as primitives and exhibit "overriding"- like properties. For instance, if a derived type constrains

[Ada] Better error message for illegal use of 'Access in a call.

2017-04-25 Thread Arnaud Charlet
This patch improves the error message in the case of an attribute reference that is an actual in a call to a subprogram inherited from a generic formal type with unknown discriminants, which makes the subprogram and its formal parameters intrinsic (see RM 6.3.1 (8) and (13)). Compiling l.adb must

[Ada] Crash on expression function with fixed point types

2017-04-25 Thread Arnaud Charlet
The compiler may crash processing a conditional expression that is part of an arithmetic expression computing a fixed point value. After this patch the following test compiles without errors. procedure P (B : Boolean) is type Fixed is delta 0.01 range -100.0 .. 100.0; X : Fixed := 10.0;

[Ada] Crash processing discriminants of private subtype

2017-04-25 Thread Arnaud Charlet
The compiler may crash processing a private tagged record type has some component whose type is a subtype of a private type. After this patch the following test compiles without errors. package Other_Type is package BS is type Bounded_String is private; private type Super_String

[Ada] Latent bug in Uintp.Most_Sig_2_Digits

2017-04-25 Thread Arnaud Charlet
This patch fixes a latent bug in Uintp.Most_Sig_2_Digits, that would cause a crash if Left is indirect and Right is direct. In fact, that combination never occurs in any existing calls. No test is available, because the bug is latent. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25

[Ada] Support for discriminants in pragma Default_Initial_Condition

2017-04-25 Thread Arnaud Charlet
This patch adds support for tagged discriminants in assertion expressions such as those of pragma Default_Initial_Condition or Type_Invariant'Class. In these contexts, tagged discriminants behave as primitives and exhibit "overriding"- like properties. For instance, if a derived type constrains

[Ada] Spurious error on subtypes of private tagged types

2017-04-25 Thread Arnaud Charlet
When a private tagged record type has some component whose type is the public declaration of a private subtype the compiler may report an spurious error on invalid conversion. The same error may be also reported on package instantiations when the actual type of some generic formal is a private

[Ada] Spurious error on deferred constant in expression function

2017-04-25 Thread Arnaud Charlet
This patch removes a spurious error on a deferred constant that appears within an expression function, when the expression is being frozen by the presence of its generated body. Such bodies are not a freeze point unless they are completions. The following must compile quietly: --- package P is

[Ada] Syntactic error recovery for case expressions

2017-04-25 Thread Arnaud Charlet
This patch improves the synactic error recovery in the case where a ";" is used instead of "," in a case expression. The following test should get these errors: case_exp_semi.ads:5:28: ";" should be "," package Case_Exp_Semi is X : Integer := 1; Y : Integer := (case X is when 1 => 1;

[Ada] Illegal renaming of conditional expression

2017-04-25 Thread Arnaud Charlet
This patch corrects a compiler bug that caused an illegal renaming to not be detected. In particular, it wasn't detected if the name in the renaming is a qualified expression whose operand is a conditional expression, and the type is a by-reference type. Tested on x86_64-pc-linux-gnu, committed

[Ada] Support for locking policies in Linux

2017-04-25 Thread Arnaud Charlet
This patch allows the locking policies Ceiling_Locking and Inheritance_Locking to be supported under Linux. No small test case is available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-25 Bob Duff * s-osinte-linux.ads (pthread_mutexattr_setprotocol,

[Ada] Private tagged subtype with renamed and constrained discriminants.

2017-04-25 Thread Arnaud Charlet
This patch fixes a compiler abort on an object declaration for a private type with discriminants, when the full view of the type is derived from an ancestor with additional discriminants and the derivation chain includes discriminant renamings. Executing gnatmake -q main main must yield:

Re: [PATCH] Support for Ada on aarch64 with -mabi=ilp32

2017-03-28 Thread Arnaud Charlet
> PR ada/80117 > * system-linux-arm-ilp32.ads: New file. > * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Use it > for aarch64-linux with -mabi=ilp32. OK, thanks. Arno

Re: [PATCH] [ADA] Fix bootstrap failure on mips64el-linux-gnuabi64

2017-03-11 Thread Arnaud Charlet
> This patch fixes an error caused by my changing of the signal constants > on MIPS in r244026. While that patch worked on mipsel, ada fails to > bootstrap with it on mips64el with the error: > > s-osinte.ads:610:07: component "sa_flags" overlaps "sa_handler" at > line 608 >

Re: Add Ada support for aarch64-*-freebsd*

2017-02-07 Thread Arnaud Charlet
> I was pointing out that on gcc-6, aarch64-linux is using x86-64 > system file too. Since I used gcc-6 for the original testing on > freebsd, that's where it came from. It's been changed on trunk, but > nobody backported those changes to gcc-6. It was obviously "good > enough" and a

Re: Add Ada support for aarch64-*-freebsd*

2017-02-07 Thread Arnaud Charlet
> This is exactly what aarch64-*-linux* is doing is doing in gcc 6 > branch (e.g. system.ads modeled it after, but now I see it has been changed to Well no, you are reusing an x86_64 file for an aarch64 architecture, so this is exactly the same issue.

Re: Add Ada support for aarch64-*-freebsd*

2017-02-07 Thread Arnaud Charlet
> The attached patch to gcc trunk enables Ada support on > aarch64-*-freebsd*. All tests pass except those affected by the > currently missing unwind support (c52103x, c52104x, c52104y, > cb1010a, cb1010c, cb1010d, gnat.dg/null_pointer_deref* (3)). > > I'd also like to get this patch backported

Re: [Ada] Ada2020 feature: partial aggregate notation (Delta aggregates).

2017-01-23 Thread Arnaud Charlet
> Please note that the trunk is in stage4, only regression bugfixes and > documentation fixes are allowed. It is possible to seek exceptions, > but committing dozens of changes that do not fix regressions or > documentation is not desirable right now. Yes I understand, although Ada isn't

[Ada] Wrong dispatching call through class-wide interface subtype

2017-01-23 Thread Arnaud Charlet
When the type of the controlling formal of a dispatching call is an interface subtype the compiler can generate code that dispatch to the wrong operation or crash the program. After this patch the following test compiles and executes well. package Small_Types is type I_Dummy is limited

[Ada] Crash on illegally terminated extended return statement

2017-01-23 Thread Arnaud Charlet
This patch modifies the construct scope stack of the parser to ensure that an extended return statement cannot have an optional end label. -- Source -- -- main.adb function Main return Boolean is begin return Result : Boolean do null; end loop; end Main;

[Ada] Aliasing checks on subprograms may cause side effects

2017-01-23 Thread Arnaud Charlet
Compiling with aliasing checks on subprograms parameters (-gnateA), if the actual of a subprogram parameter is a function call the compiler may generate a runtime check that invokes the function more than once. After this patch the following test compiles and executes well. with Ada.Text_IO; use

[Ada] Ada2020 feature: partial aggregate notation (Delta aggregates).

2017-01-23 Thread Arnaud Charlet
This patch implements AI12-0127, which describes a new constructor for aggregate in terms of an existing record or array aggregate and a series of component-wise modifications of its value. Executing: gnatmake -gnat2020 -q a2020 a2020 must yield: 1 2 9 16 25 --- with Text_IO; use

[Ada] Missing detection of illegally placed pragma Assert

2017-01-23 Thread Arnaud Charlet
This patch modifies the parsing of protected and task definitions to detect illegal placement of pragmas Assert and Debug within the protected or task item lists. -- Source -- -- synch_pragmas.ads package Synch_Pragmas is protected PO is pragma Assert

[Ada] Pragma Discard_Names and exception declarations

2017-01-23 Thread Arnaud Charlet
This patch extends the functionality of pragma Discard_Names to suppress the generation of the String names of exception declarations. As a result, these names do not appear in the final binary. A side effect of this functionality is that routine Ada.Exceptions.Exception_Name will return an empty

[Ada] Validity checks prevent copy back of scalar IN OUT parameter

2017-01-23 Thread Arnaud Charlet
This patch modifies the generation of validity checks to generate a renaming of the expression being verified when the expression denotes a name. For all other kinds of expressions, the validity check machinery creates a constant to store the value of the expression. The use of renaming prevents

[Ada] Crash on class-wide 'Attribute clause

2017-01-23 Thread Arnaud Charlet
This patch adds an extra restriction to the placement of an 'Address attribute definition clause where a prefix of a class-wide type cannot be subject to the clause. -- Source -- -- types.ads with Ada.Finalization; use Ada.Finalization; package Types is type

[Ada] Missing range check on if expression

2017-01-23 Thread Arnaud Charlet
This patch removes an optimization when evaluating integer literals within qualified expressions that caused checks on if and case expressions to not be generated properly. -- Source -- -- call_do_smth.adb with Test; use Test; with Ada.Text_IO; procedure Call_Do_Smth

[Ada] Update SPARK rules for checking volatile flavors of protected objects

2017-01-23 Thread Arnaud Charlet
Implement new rule SPARK RM 7.1.2(16) that only assigns the Async_Readers and Async_Writers flavors of volatility to protected objects by default, and makes protected objects inherit the Effective_Reads and Effective_Writes flavors of volatility from their Part_Of components. Tested on

[Ada] Implement AI95-0133 in Ada 95 (and Ada 83) mode

2017-01-23 Thread Arnaud Charlet
The original interpretation of record representation clauses with reverse bit order from Ada 95 was modified by a Binding Interpretation (AI95-0133). Apply it by default even in running in -gnat95 mode (as is already unconditionally done in Ada 2005 move and above), since the original behaviour is

[Ada] Implementation of AI12-125-3 : add @ as abbreviation for LHS.

2017-01-23 Thread Arnaud Charlet
This is a first check-in for the implementation of Ada Issue AI12-0125-3, that proposes the use of '@' to designate the LHS of an assignment within the corresponding RHS. The following is a simple example of use: --- with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types; with

[Ada] Proper matching of attribute 'Result in Refined_Depends

2017-01-23 Thread Arnaud Charlet
This patch updates the analysis of pragma Refined_Depends to properly match a dependence clause with output ...'Result against a refinement clause with output ...'Result. The patch introduces a mechanism to handle clarification clauses. These are clauses which indicate that a particular

[Ada] Spurious error on convention of anonymous access-to-subprogram type

2017-01-23 Thread Arnaud Charlet
This patch ensures that Ada RM 6.3.1 13.1/3 which states The calling convention for an anonymous access-to-subprogram parameter or anonymous access-to-subprogram result is protected if the reserved word protected appears in its definition; otherwise, it is the convention of the

[Ada] Allocating large modular arrays

2017-01-23 Thread Arnaud Charlet
This patch computes a guard for a storage error on an object declaration for an array type with a modular index type with the size of Long_Long_Integer. Special processing is needed in this case to compute reliably the size of the object, and eventually to raise Storage_Error, when wrap-around

[Ada] Crash on overloaded function call with limited view

2017-01-20 Thread Arnaud Charlet
This patch fixes a compiler abort on a call to a function that returns a limited view of a type. The following sources must compile quietly: limited with Root; package Api is type Object is tagged null record; function Is_Present (Name : in String) return Boolean; function Get (Name :

[Ada] Warn on non-standard check pragmas

2017-01-20 Thread Arnaud Charlet
The pragma Check_Poliy and the names Precondition / Postcondition were introduced in GNAT before the Ada2012 standardization, and they have a different behavior from that of the standardized pragma Assertion_Policy. Rather than making the behavior of both more conformant we choose to preserve the

[Ada] Legality and removal of ignored Ghost context clauses

2017-01-20 Thread Arnaud Charlet
This patch implements several checks on use clauses to prevent mixing Ghost and non-Ghost names. A context clause is marked as ignored Ghost when it mentions an ignored Ghost package or type. Pruning of ignored Ghost code now looks at compilation unit nodes in order to remove ignored Ghost clauses

[Ada] Update Ada.Locales for RM 2012 COR:1:2016

2017-01-20 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2017-01-20 Pascal Obry * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016 Index: a-locale.adb === --- a-locale.adb(revision

[Ada] Fix typing in special frontend inlining for GNATprove

2017-01-20 Thread Arnaud Charlet
In some cases of an assignment to an unconstrained formal parameter being inlined as part of the special frontend inlining in GNATprove mode, the inlined assignment is to an unconstrained view of a constrained local variable, which is unexpected in GNATprove. Rather, keep the most precise type of

[Ada] Spurious error on Default_Initial_Condition

2017-01-20 Thread Arnaud Charlet
This patch modifies the generation of the Default_Initial_Condition procedure to disregard class-wide types and the underlying full views of private types. In addition, the patch preserves the attributes of freeze nodes when the partial and/or full views of a private type inherit the freeze node

[Ada] Missing invariant procedure body in SPARK mode

2017-01-19 Thread Arnaud Charlet
This patch modifies the generation of the invariant procedure body as follows: * The body of the "partial" invariant procedure is still generated at the end of the visible declarations. * The body of the "full" invariant procedure is generated when the related type is frozen or at

[Ada] Better error message on illegal selected component with overloaded prefix.

2017-01-19 Thread Arnaud Charlet
This patch inproves the error report produced on a selected component Nam.Comp which appears in an object declaration, when Nam has seeveral interpretations as a function, and there is non-visible package with the same name. Compiling pqi.adb must yield: pqi.adb:15:07: no legal

[Ada] Memory leak on function returning a limited view result

2017-01-19 Thread Arnaud Charlet
This patch modifies the processing of subprograms to properly frag a function as returning by reference when the return type is a limited view and the full view of the type requires the secondary stack. -- Source -- -- pack_1.ads with Pack_2; with Ada.Finalization;

[Ada] Spurious dimensionality errors in inlined bodies.

2017-01-19 Thread Arnaud Charlet
This patch removes spurious dimensionality errors in programs that are compiled with front-end inlining (as in SPARK mode). The original model of dimensionality checking analyzes only nodes coming from source because the correctness of the dimensioned program only depends on source user code.

[Ada] Spurious dimensional error in SPARK mode

2017-01-13 Thread Arnaud Charlet
THis patch removes a spurious error on mismatched dimensions in the body of a subprogram that is inlined for SPARK purposes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-01-13 Ed Schonberg * sem_ch8.adb (Analyze_Expanded_Name): Perfrom dimension

[Ada] Inlining of expression function returning controlled object

2017-01-13 Thread Arnaud Charlet
Pragma Inline_Always has been extended to support inlining of calls to expression functions that return a controlled object if the expression function fulfills all the following requirements: 1. Has pragma/aspect Inline_Always 2. Has no formals 3. Has no contracts 4. Has no dispatching

[Ada] Expression functions as completions and private types

2017-01-13 Thread Arnaud Charlet
An expression function that is a completion is a freeze point for all entities referenced in its expression. As a consequence, a reference to an uncompleted private type declared in an enclosing scope is illegal. This patch adds the proper check to enforce this rule. Compiling env_baselines.ads

Re: Restore Solaris/SPARC Ada bootstrap

2017-01-13 Thread Arnaud Charlet
> * gcc-interface/Makefile.in: Clean up VxWorks targets. > > included a typo which broke Solaris/SPARC bootstrap: > > gcc-interface/Makefile:1274: *** missing separator. Stop. > make[3]: Leaving directory > '/var/gcc/regression/trunk/12-gcc/build/gcc/ada' > Makefile:122: recipe for

[Ada] Static predicates on strings

2017-01-13 Thread Arnaud Charlet
RM 3.2.4 stipulates that comparison operators on strings are legal in the expression for a Static_Predicate aspect of a string type. The implementation of this capability was deferred because it conflicts with the definition of static expression (RM 4.9) which excludes string comparisons from

[Ada] Conformance of quantified expressions

2017-01-12 Thread Arnaud Charlet
This patch implements AI12-050, which extends the conformance rules to Ada2012 quantified expressions. Previously the conformance of corresponding identifiers in the two expressions required that they denote the same entity. The loop parameters of two quantified expressions are conformant if the

[Ada] Adapt detection of errors to gnat2why changes of Warning_Mode

2017-01-12 Thread Arnaud Charlet
In gnat2why, the executable used in GNATprove, Warning_Mode is changed between the initial and final work done in frontend (controlled by -gnatws in particular) and the work in between done in gnat2why (controlled by GNATprove switch --warnings). This requires storing the detection of an error

[Ada] Inheritance of predicates in derived scalar types.

2017-01-12 Thread Arnaud Charlet
This patch fixes an omission in the inheritance of predicate aspects in type derivations. The parent type may be a subtype declaration or a type declaration with a dynamic predicate aspect, and the aspect applies to a first subtype, not to its anonymous parent type. Eecuting: gnatmake -q

[Ada] Crash on missing full view of controlled private type

2017-01-12 Thread Arnaud Charlet
This patch protects adjustment, finalization, and initialization-related code from scenarios where a private type may not have been successfully frozen due to a missing full view. -- Source -- -- missing_view.ads with Ada.Finalization; use Ada.Finalization; package

[Ada] Allow user-specified elaboration order constraints

2017-01-12 Thread Arnaud Charlet
This patch adds a new feature that allows the user to specify a particular elaboration order for some or all library items in the program. The following test should produce the following output: Command line: gprbuild -q -f -gnatE -g p-main.adb -bargs -l -felab-order.txt elab-order.txt file:

[Ada] Missing type invariant check on view conversion

2017-01-12 Thread Arnaud Charlet
This patch corrects an issue with "out" or "in out" arguments producing wrong code when the argument is view converted. According to RM 7.3.2 (11-14) invariant checks of intermediate types must be preformed in the order of the parent to the child (skipping the parent) after the subprogram. With

Re: [Ada] Fix PR ada/78845

2017-01-10 Thread Arnaud Charlet
> >> 2016-12-21 Simon Wright >> > > >> > >>PR ada/78845 > >>* a-ngcoar.adb (Inverse): call Unit_Matrix with First_1 set to > >>A'First(2) > >> and vice versa. > >>* a-ngrear.adb (Inverse): likewise. > > Can the patch be

[Ada] Allow task-type specific secondary-stack size definition

2017-01-06 Thread Arnaud Charlet
This patch provides a GNAT specific aspect and pragma Secondary_Stack_Size that enables users to specify the size of the secondary stack for each task type. On targets that use dynamic secondary stack size allocation, this pragma defines the initial size of the secondary stack. On targets using

[Ada] Add Flush to Sequential_IO and Direct_IO.

2017-01-06 Thread Arnaud Charlet
This Flush routine is equivalent to the one found in the Text_IO package for example. The Flush procedure synchronizes the external file with the internal file (by flushing any internal buffers) without closing the file. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-01-06 Pascal Obry

[Ada] pragma Rename_Pragma

2017-01-06 Thread Arnaud Charlet
This patch implements a new GNAT-specific pragma Rename_Pragma, which is helpful when porting code from other compilers that have similar pragmas but with different names. pragma Rename_Pragma (New_Name => Inline_Only, Renamed => Inline_Always); causes GNAT to treat "pragma

[Ada] Spurious error on case statement with conversion and static predicate

2017-01-06 Thread Arnaud Charlet
This patch fixes a spurious error on a case statement whose expression is a type conversion of a variable whose initial value is known, and whose type has a static predicate. Executing: gnatmake -q static_predicate_example static_predicate_example gnatmake -q -f -gnata

[Ada] Create new attribute Finalization_Size for header of control objects

2017-01-06 Thread Arnaud Charlet
This patch creates a new attribute Finalization_Size for all objects. Its result is an integer which represents the internal header size (including padding) required by the object's type to store the additional data used during finalization. -- Source -- -- fail.ads

[Ada] Max_Queue_Length aspect for protected entries

2017-01-06 Thread Arnaud Charlet
This patch implements the semantics of aspect/pragma Max_Queue_Length which restricts the entry queue length for protected entries by allowing the aspect and pragma Max_Queue_Length to appear directly after protected entries followed by a single argument -- a positive integer. To achieve the

[Ada] Missing finalization on function result

2017-01-06 Thread Arnaud Charlet
This patch updates the funalization mechanism to correctly recognize a redefined unary operator which returns an interface class-wide type. Such objects require finalization actions. -- Source -- -- types.ads with Ada.Finalization; use Ada.Finalization; package Types

[Ada] Support for new socket options

2017-01-06 Thread Arnaud Charlet
Make Linux specific option SO_BUSY_POLL accessable as Busy_Polling option. Also offer a generic API to set options that were not available at compiler build time. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-01-06 Thomas Quinot * s-oscons-tmplt.c,

[Ada] Missing range check on 'Read result

2017-01-06 Thread Arnaud Charlet
This patch modifies the expansion of attribute 'Read to ensure that relevant checks are properly installed on the return value obtained by calling the related Read routine. This is done by means of a type conversion to the target type. -- Source -- -- types.ads with

[Ada] Implicit Elaborate_All(P) in P

2017-01-06 Thread Arnaud Charlet
This patch fixes a bug where the compiler would add an implicit pragma Elaborate_All(P) to the body of P itself, causing gnatbind to find a spurious elaboration cycle. The following test must build quietly. gnatmake -q -f main.adb with Ada.Finalization; package Ctrl is type T (Object :

Re: [PATCH 2/2] [ADA] Fix constants in s-linux-mips.ads

2017-01-03 Thread Arnaud Charlet
> This patch corrects various constants in s-linux-mips.ads. A large > proportion (especially the signals) were simply wrong on MIPS. It also > fixes the struct sigaction offsets which are incorrect on 64-bit > systems because sa_flags is an int (always 32-bits), and not a pointer. > > Thanks, >

Re: [PATCH 1/2] [ADA] Fix MIPS big-endian build

2017-01-03 Thread Arnaud Charlet
> This patch merges the mips and mipsel sections in > gcc-interface/Makefile.in favoring the existing variables in mipsel. > Over time, the mipsel target was tested much more than the mips target > and a number of fixes were applied which should have been applied to > both. Since the only real

Re: [Ada] Fix PR ada/78845

2016-12-21 Thread Arnaud Charlet
> > Yes, please resend an updated patch. > > The function Ada.Numerics.Generic_Real_Arrays.Inverse is required > (ARM G.3.1(72)) to > return a matrix with the bounds of the dimension indices swapped, i.e. > result'Range(1) == > input'Range(2) and vice versa. The present code gets result'Range(1)

Re: [Ada] Fix PR ada/78845

2016-12-21 Thread Arnaud Charlet
> >> 2016-12-17 Simon Wright > >> > >>PR ada/78845 > >>* a-ngrear.adb (Inverse): call Unit_Matrix with First_1 set to > >>A'First(2) > >>and vice versa. > > > > Patch is OK, thanks. > > The same problem exists in Ada.Numerics.Generic_Complex_Arrays >

Re: [Ada] Fix PR ada/78845

2016-12-20 Thread Arnaud Charlet
> The function Ada.Numerics.Generic_Real_Arrays.Inverse is required > (ARM G.3.1(72)) to return a matrix with the bounds of the dimension indices > swapped, i.e. result'Range(1) == input'Range(2) and vice versa. The > present code gets result'Range(1) correct, but result'Range(2) always > starts

Re: [ada, testsuite] Parallelize check-gnat

2016-10-21 Thread Arnaud Charlet
> Ok for mainline (and eventually for 5 and 6 branches given the small > size and low risk of the patch)? I'm not familiar with lang_checks_parallelized, but that's OK with me on principle. Arno

<    1   2   3   4   5   6   7   8   9   10   >