[Ada] Fix inefficiency in Operator_Matches_Spec

2016-04-18 Thread Arnaud Charlet
First_Formal is not as cheap as it used to be so this patch eliminates a few redundant invocations in Operator_Matches_Spec. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Eric Botcazou * sem_type.adb (Operator_Matches_Spec): Call First_Formal on

[Ada] Fix small inefficiency in Disambiguate

2016-04-18 Thread Arnaud Charlet
This prevents the procedure from calling Covers for standard operators when this is not necessary. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Eric Botcazou * sem_type.adb (Disambiguate): Call Covers only when necessary for standard ope

[Ada] Add statistics dumping function to Atree package

2016-04-18 Thread Arnaud Charlet
This adds a statistics dumping function to the Atree package, which is the package responsible for the allocation of the nodes of the front-end tree. No user-visible functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Eric Botcazou * atree.ads (Num_Extens

[Ada] Spurious inlining error with function completed by an expression function

2016-04-18 Thread Arnaud Charlet
This patch fixes a spurious error on a call to an expression function whose expression is a call to a function whose full declaration is another expression function, when compiling with optimization and inlining warnings enabled. The following must compile quietly: gcc -c p.adb -gnatn -O -fdum

[Ada] Spurious errors on tag indeterminate calls.

2016-04-18 Thread Arnaud Charlet
This patch removes spurious errors on tag indeterminate calls that are actuals of other dispatching calls that may themselves be tag-indeterminate. Full test in ACATS 4.0G BC60004 Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Ed Schonberg * sem_disp.adb (Check_Dispatch

[Ada] Implicit self dependence of task on itself

2016-04-18 Thread Arnaud Charlet
This patch implements the following SPARK rule from 6.1.4: The Depends and Refined_Depends aspect of a task unit T need not mention this implicit parameter; an implicit specification of "T => T" is assumed, although this may be confirmed explicitly. -- Source --

[Ada] Derivation of Ghost types

2016-04-18 Thread Arnaud Charlet
This patch implements the following rules from the SPARK RM: 6.9(8) - A ghost primitive subprogram of a non-ghost type extension shall not override an inherited non-ghost primitive subprogram. A non-ghost primitive subprogram of a type extension shall not override an inherited ghost pr

[Ada] Warning on (others => <>) that does not cover any components.

2016-04-18 Thread Arnaud Charlet
This patch adds a warning on a record aggregate that includes an association with a box, when all other components of the record have explicit associations in the aggregate. Compiling: gcc -c -gnatwr question.ads must yield: question.ads:13:53: warning: others choice is redundant questi

[Ada] New function GNAT.Source_Info.Compilation_ISO_Date

2016-04-18 Thread Arnaud Charlet
This patch adds a new function Compilation_ISO_Date to package GNAT.Source_Info. It is identical to Compilation_Date, except that the date is returned in standard ISO form -- "-mm-dd". This form has the advantage that string comparisons like "<" can be used to determine the order of dates. The

[Ada] Overflow in internal compiler tables

2016-04-18 Thread Arnaud Charlet
When compiling sources with many imported units, some tables internal to the compiler may overflow, for example the dependency table. This patch increase the maximum size of these internal table to a value that will never be reached. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 V

[Ada] Remove SPARK legality checks performed in GNATprove

2016-04-18 Thread Arnaud Charlet
Checks that some types and objects are fully default initialized should be performed in GNATprove, where relevant information about SPARK status of private types in particular is available. Move two tests performed in the frontend to GNATprove here. Tested on x86_64-pc-linux-gnu, committed on trun

[Ada] Optimization of Unbounded_Priority_Queues

2016-04-18 Thread Arnaud Charlet
This patch improves the efficiency of Ada.Containers.Unbounded_Priority_Queues, especially in the case where many same-priority items are enqueued. No test, because no change in behavior. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Bob Duff * a-cuprqu.ads: Change the

[Ada] Clean up global variables

2016-04-18 Thread Arnaud Charlet
This patch eliminates some uses of global variables in the GNAT front end. No test; no change in behavior. 2016-04-18 Bob Duff * sem_elab.adb (Output_Calls): Use Get_Name_String, to clearly indicate that the global Name_Buffer is being used. The previous code used Is_In

[Ada] Improved error message for illegal procedure function definition.

2016-04-18 Thread Arnaud Charlet
This patch adds information on an illegal definition for a stream procedure, indicating that the second argument of the procedure must be a first subtype. Compiling host-msg.ads must yield: host-msg.ads:11:08: formal of stream operation must be a first subtype host-msg.ads:12:41: incorrect

[Ada] Stream output to fifos

2016-04-18 Thread Arnaud Charlet
This patch fixes a regression in stream output to fifos (named pipes). When a fifo is opened for output, the process should block until another process opens the fifo for reading. This is now (again) the case. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Bob Duff * s-f

[Ada] Issue check instead of error in static division by zero

2016-04-18 Thread Arnaud Charlet
In some cases of generic instantiations, or code configuration, some code may be deactivated and contain static divisions by zero. Instead of issuing an error in SPARK code, generate a suitable check. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Yannick Moy * sem_eval.

[Ada] Compiler error and crash over iterators over qualified expressions.

2016-04-18 Thread Arnaud Charlet
This patch handles properly Ada 2012 loops whose iterator specification is a qualified expression whose type is derived from an iterator type. Executing gnatmake -q ice_primes_2.adb ice_primes_2 must yield: 3 5 7 11 13 17 19 23 29 31 --- with Ada.Text_IO; with F552A00_Prime_Num

[Ada] File descriptors leaking

2016-04-18 Thread Arnaud Charlet
Two file descriptors are never closed when invoking Non_Blocking_Spawn version with String parameters Stdout_File and Stderr_File. They are now closed. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-18 Vincent Celier * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_F

Re: Please include ada-hurd.diff upstream (try2)

2016-04-19 Thread Arnaud Charlet
> The updated attachment was included in message > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg01659.html You should just put a FSF copyright on s-osinte-gnu.adb OK with this change. Arno

[Ada] Illegal use of type name in a context where it is not a current instance.

2016-04-19 Thread Arnaud Charlet
This patch fixes an omission in the code that checks the legality of a type name as a prefix of 'access. These uses are allowed when the type name is a current instance, but previously the compiler allowed these uses within aggregates not within the declarative region of the type. Compiling priori

[Ada] Withing Ghost units

2016-04-19 Thread Arnaud Charlet
This patch implements context clauses for Ghost compilation units. It is now possible to "with" and "use" a Ghost unit. If the Assertion_Policy for Ghost is set to "Ignore", the Ghost compilation units do not generate ALI or object files, and no cross-referencing information is present in living AL

[Ada] Always require an elaboration counter when preserving control flow

2016-04-19 Thread Arnaud Charlet
When control flow preservation is requested, we want to be explicit about the units elaboration order in a partition, and we need to have the elaboration counter available for that. This patch ensures we do, even in circumstances where we are otherwise allowed to omit the elaboration counter, e.g.

[Ada] Use thread_id as lwp id on Darwin

2016-04-19 Thread Arnaud Charlet
Not a functional change, but allows the use of debugserver for task switching by gdb. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-19 Tristan Gingold * adaint.c (__gnat_lwp_self): New function (for darwin). * s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Im

[Ada] Undefined symbol with invariant and private type extension

2016-04-20 Thread Arnaud Charlet
This patch modifies the generation of type invariant procedures to insert the generated spec at the end of the visible declarations and the generated body to the end of the private (higher precedence) or visible declarations. -- Source -- -- p1.ads package P1 is typ

[Ada] Legality of aspect Default_Storage_Pool

2016-04-20 Thread Arnaud Charlet
This patch verifies that when Default_Storage_Pools is specified by means of an aspect, the entity to which it applies is a package or a subprogram. Compiling pck2.ads must yield: pck2.ads:4:11: aspect must apply to package or subprogram --- with GNAT.Debug_Pools; package Pck2 is Pool : GN

[Ada] Spurious error in if_expression with universal then_expression

2016-04-20 Thread Arnaud Charlet
If the first branch of an if-expression is a literal, remaining expressions can resolve to any integer type (or any real type depending on the literal). Tested in ACATS 4.0J test B457007 Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-20 Ed Schonberg * sem_res.adb (Resolve_

[Ada] Do not use secondary stack in some cases

2016-04-20 Thread Arnaud Charlet
The compiler is no longer using the secondary stack in the case of "for ... of" loops over arrays. No small test case is available. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-20 Bob Duff * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary stack

[Ada] Wrong resolution of intrinsic in postcondition

2016-04-20 Thread Arnaud Charlet
This patch ensures that intrinsic operators that act as generic actuals are properly resolved and rewritten in the instance when the context is a fully analyzed and expanded pre/postcondition. Prior to this change the rewriting guard was too restrictive and led to erroneous resolution. ---

[Ada] Crash on configuration pragma Check_Policy.

2016-04-20 Thread Arnaud Charlet
There are two different syntaxes for this pragma, and the analysis of the pragma in the new syntax results in the construction of one or more pragmas in the older form. If the original pragma appears in a configuration file the generated ones must be inserted in the same file because Insert_Actions

[Ada] Better error message for illegal aspect

2016-04-20 Thread Arnaud Charlet
This patch improves on the error message for an aspect whose expression freezes the entity to which it applies. Compiling BD11002.adb must yield: bd11002.adb:3:02: aspect specification causes premature freezing of "Size" --- procedure BD11002 is Sizer : constant Natural := Integer'Size wit

[Ada] Constraint_Error on spurious ambiguity in instance

2016-04-20 Thread Arnaud Charlet
This match modifies the processing of generics to aid overload resolution of binary and unary operators in instances. This is achieved by installing type conversions in the form of qualified expressions for each operand that yields a universal type. -- Source -- -- px.a

[Ada] Spurious discriminant error on aggregate for derived type

2016-04-20 Thread Arnaud Charlet
This patch extends the mechanism used to provide discriminants values for an aggregate of a derived type that constrains some parent discriminants and renames others, when the type of the target is unconstrained. No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04

[Ada] Constraint_Error on spurious ambiguity in instance

2016-04-20 Thread Arnaud Charlet
This patch updates the instantiation machinery to properly preserve a reference to a global type in a qualified expression used to convert a universal literal to a specific type, and propagate it to the instantiated template. -- Source -- -- types.ads package Types is

[Ada] Missing style warning on overlong line is task subunit

2016-04-20 Thread Arnaud Charlet
This patch restores a warning message on an overlong line in a subunit that is a task body, when compiling the parent unit. Compiling: gcc -c -gnatyM50 par.adb must yield: par-separated_task.adb:6:51: (style) this line is too long --- opackage Par is task type Separated_Task is en

[Ada] Spurious error on binary operator in instance

2016-04-20 Thread Arnaud Charlet
This patch updates the mechanism which qualifies universal literals that act as operands of binary or unary operators to avoid the partial qualification of the subtype_mark when the immediate scope of the corresponding actual parameter is a generic unit. No simple reproducer possible. Tested on x8

[Ada] Leak with function returning String in exception handler

2016-04-20 Thread Arnaud Charlet
This patch modifies the transient scope mechanism to ignore blocks generated for exception handlers with a choice parameter when propagating secondary stack information up the scope stack. Such blocks are not physically present in the tree and can never release the secondary stack on exit. ---

[Ada] Illegal use of current instance in attribute reference

2016-04-20 Thread Arnaud Charlet
The current instance of a type in an aspect specification is an object of the type. If the type is scalar, it cannot be the prefix of an attribute reference such as 'First, whose prefix must an array object (even though it can be a scalar type in other contexts). Compiling foo.adb must yield: foo

[Ada] Spurious discriminant check on type with unknown discriminants

2016-04-20 Thread Arnaud Charlet
This patch removes a spurious discriminant check on an generated assignment statement in an iterator loop, when the cursor type is a type with unknown discriminants, when the full view has discriminants with defaults. Executing: gnatmake -f -q -g date_iteration_test.adb date_iteration_test

[Ada] Spurious errors with generalized iterators

2016-04-21 Thread Arnaud Charlet
This patch fixes some spurious errors in a generalized iterator over a user- defined container, when the first parameter of the Iterate function is an access parameter, and the iterator type is locally derived. Executing; gnatmake -q ausprobieren.adb ausprobieren must yield: 5 999

[Ada] Improved handling of rep item chains

2016-04-21 Thread Arnaud Charlet
This patch is an internal improvement to the handling of rep item chains of types. The inheritance of rep item chains can how avoid potential cycles. No need for a test, no change in behavior. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-21 Hristian Kirtchev * sem_aux.ads

[Ada] Freezing a subprogram does not always freeze its profile

2016-04-21 Thread Arnaud Charlet
AI05-019 specifies the conditions under which freezing a subprogram also freezes the profile of the subprogram. Prior to this patch the profile was frozen unconditionally, leading to spurious errors. Examples in ACATS test BDD2004. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-21 Ed

[Ada] Minor changes to warning message for exe filenames on Windows

2016-04-21 Thread Arnaud Charlet
Change wording of the warning message on problematic filenames to be more neutral. Add a new substring "patch" introduced on Windows 10. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-21 Vasiliy Fofanov * gnatlink.adb: Change wording of the warning message on proble

[Ada] Improved exception message for Host_Error

2016-04-21 Thread Arnaud Charlet
GNAT.Sockets.Host_Error is the exception raised when a host name or address lookup fails. This change improves the associated exception message by including the offending name or address The following test case must display: raised GNAT.SOCKETS.HOST_ERROR : [1] Host not found: nonexistent-host w

[Ada] Minimizing recompilation with multiple limited_with clauses

2016-04-21 Thread Arnaud Charlet
This patch simplifies the contents of Ali files, but removing from it dependency lines that denote units that are not analyzed, because they only appear in the context of units named in limited_with clauses. The following must execute quietly: gcc -c -gnatc a_things.ads grep c_things a_thi

[Ada] Incorrect result of equality on multidimensional packed arrays

2016-04-21 Thread Arnaud Charlet
This patch corrects an oversight in the computation of size of multidimensional packed arrays. Previously to this patch only the first dimension was used to determine the number of storage units to compare. Executing gnatmake -q equality.adb equality must yield Success - comparison cl

[Ada] Detection of missing abstract state refinement

2016-04-21 Thread Arnaud Charlet
This patch implements a mechanism which detects missing refinement of abstract states depending on whether a package requires a completing body or not. The patch also cleans up the two entity lists used to store refinement and Part_Of constituents of abstract states. -- Source --

Re: Please include ada-hurd.diff upstream (try2)

2016-04-25 Thread Arnaud Charlet
> Is replacing > > +-- Copyright (C) 1991-1994, Florida State > University-- > +-- Copyright (C) 1995-2014, > AdaCore -- > +--  Copyright (C) 2015-2016, Free Software Foundation, > Inc. -- > > with only > > +--  

Re: Please include ada-hurd.diff upstream (try2)

2016-04-25 Thread Arnaud Charlet
> Attaching the modified ada-hurd.diff. Maybe it is ready for inclusion in > upstream now? Patch is OK, go ahead and commit it, thanks. > 2016-03-31 Svante Signell > > * gcc-interface/Makefile.in: Add support for x86 GNU/Hurd. > * s-osinte-gnu.ads: New specification file. >

[Ada] Expression functions need not trigger loading of package body

2016-04-27 Thread Arnaud Charlet
The expression functions introduced in Ada 2012 implicitly come with the Inline aspect in GNAT. And, for inter-unit inlining, they were handled by the inlining machinery as any other inlined subprograms, which means that they were causing the package body (if any) to be loaded and analyzed. That'

[Ada] Reimplementation of interfacing aspects

2016-04-27 Thread Arnaud Charlet
This patch reimplements the handling of Convention, Export, External_Name, Import, and Link_Name to generate a proper corresponding pragma depends on which of these aspects are present. As a result, an exported or imported subprogram with preconditions and/or postconditions will not cause a crash

[Ada] Remove superfluous use of secondary stack on object initialization

2016-04-27 Thread Arnaud Charlet
This patch improves on the performance of an object initialization with a build-in-place function call, when the return type is not a definite type but has only access discriminants and no controlled components. THe following must execute quietly: gcc -c -gnatDG p.adb grep secondary_stack p

Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP

2016-09-25 Thread Arnaud Charlet
> int > __gnat_get_maximum_file_name_length (void) > { > +#if defined (__DJGPP__) > + return (_use_lfn(".")) ? -1 : 8; > +#else >return -1; > +#endif > } Is the above change really necessary? Would be nice to get rid of this extra code. The rest looks OK to me. Arno

Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP

2016-09-25 Thread Arnaud Charlet
> >Is the above change really necessary? Would be nice to get rid of this > >extra code. The rest looks OK to me. > It is required for support of environment when LFN support is either > not available or disabled for some reason (for example FreeDOS > without LFN support loaded). Does it matter fo

Re: Implement -Wimplicit-fallthrough (version 9)

2016-09-26 Thread Arnaud Charlet
> this patch caused quite some breakage: Ada, Solaris/x86 and SPARC don't > bootstrap any longer. > > The following patch allows i386-pc-solaris2.12 and > sparc-sun-solaris2.12 > bootstraps continue. > > Strangely, I needed to use gcc_fallthrough () in i386.c; a mere /* FALLTHRU > */ > had no ef

Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP

2016-10-10 Thread Arnaud Charlet
> >> int > >> __gnat_get_maximum_file_name_length (void) > >> { > >>+#if defined (__DJGPP__) > >>+ return (_use_lfn(".")) ? -1 : 8; > >>+#else > >>return -1; > >>+#endif > >> } > >Is the above change really necessary? Would be nice to get rid of this > >extra code. The rest looks OK to me.

Re: [PING][PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-10-11 Thread Arnaud Charlet
> I'd like to ping this patch. > > Last version of the patch together with Changelog entry can be found in > mailing list archive: > > https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01229.html This patch isn't OK, we don't want to add such special case in s-os_lib.adb Arno

Re: [PING][PATCH 3/4][Ada,DJGPP] Ada support for DJGPP

2016-10-11 Thread Arnaud Charlet
> I'd like to ping patch > > https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00164.html > > Additional comments about using ZCX_By_Default := true are in > https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00845.html Well this patch doesn't inspire lots of confidence since the initial version had the

[Ada] Call memmove instead of memcpy in more cases

2016-10-12 Thread Arnaud Charlet
This changes the logic of Is_Non_Local_Array to return true for anything that is not a component or a slice of a local entity, for example a dereference, so as to generate a call to memmove instead of memcpy in more cases, e.g.: package P is type String_Access is access all String; type Rec1

[Ada] Spurious errors on instances of formal packages with defaults.

2016-10-12 Thread Arnaud Charlet
This patch fixes spurious errors on instantiations of formal packages that have defaulted formals that include tagged private types and array types. The following must compile quietly: gcc -c lis3dsh_spi.ads --- with SPI_Bus_Driver; with LIS3DSH; package LIS3DSH_SPI is new LIS3DSH (IO => SPI

[Ada] Create a new internal profile

2016-10-12 Thread Arnaud Charlet
This new profile is not user visible and is the base to switch to the restricted tasking runtime. It replaces the Restricted profile for that purpose and is weaker than it. The Restricted profile remains unchanged. The purpose of that change is to lift some restrictions of the GNAT_Extended_Ravens

[Ada] Preliminary work to support relative delays on extended ravenscar

2016-10-12 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2016-10-12 Tristan Gingold * exp_ch9.adb (Expand_N_Delay_Relative_Statement): Add support for a secondary procedure in case of missing Ada.Calendar.Delays * rtsfind.ads (RTU_Id): Add System_Relative_Delays. (RE_I

[Ada] Renaming of functions to check file's readability/writability

2016-10-12 Thread Arnaud Charlet
Old functions to check readability/writability of file based on file's attributes had been replaced by new more precise functions. Old functions are provided under new names. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-10-12 Vadim Godunko * s-os_lib.ads (Is_Owner_Readable_F

[Ada] Crash on overloaded function call with limited view

2016-10-12 Thread Arnaud Charlet
This patch fixes a compiler abort on a call that is initially overloaded, when the resolved function returns the limited view of a type. The folllowing must compile quietly: gcc -c p.adb --- with R; package body P is function Get (A : Q.Ptr) return Integer is begin return R.Conv

[Ada] Illegal overriding indicators not flagged for procedure named Initialize

2016-10-12 Thread Arnaud Charlet
In cases of dispatching operations with names Initialize, Adjust, and Finalize that will override an inherited procedure at the point of the full type but not at their point of declaration, the compiler was not properly flagging an overriding_indicator on such a procedure as illegal, because proced

[Ada] Spurious use visibility with limited with and child packages

2016-10-12 Thread Arnaud Charlet
This patch corrects a minor issue whereby declarations that occur immediately within package P are erroneously treated as potentially use-visible when a parent package has a limited with clause on P, a child package has a with clause on P, and the child package is a client of another unit. --

[Ada] Allow Refined_Global/Depends contracts with partial refinement

2016-10-12 Thread Arnaud Charlet
Pragmas/aspects Refined_Global and Refined_Depends may be applied in a scope where only partial refinement of abstract states is visible, as defined in SPARK RM 7.2.4. In such a case, the partial refinement should be used instead of the full refinement for checking the refined contracts. Tested on

[Ada] Spurious error on renaming of type conversion with invariant.

2016-10-12 Thread Arnaud Charlet
This patch fixes a spurious error on a renaming of a conversion of the designated object of a pointer to class-wide type when the target type has an invariant aspect. The following must execute quietly: gnatmake -gnata -q main main --- with System.Assertions; use System.Assertions; with Gd

[Ada] Premature finalization of controlled array component

2016-10-12 Thread Arnaud Charlet
This patch modifies the processing of transient array components to properly handle the finalization of the temporary controlled function result when the call initializes a component choice list or an "others" choice. -- Source -- -- aggregates.adb with Ada.Strings.Unb

[Ada] Missing predicate check with explicit policy pragma

2016-10-12 Thread Arnaud Charlet
This patch fixes an omission in the generation of predicate checks, when there is a configuration pragma that sets Assertion_Policy to Ignore and a subsequent configuration pragma that enables predicate checking. Executing: gnatmake -q main main must yield raised SYSTEM.ASSERTIONS.ASSERT_

[Ada] Pragmas Compile_Time_Error and Compile_Time_Warning and 'Size

2016-10-13 Thread Arnaud Charlet
Extend the functionality of pragmas Compile_Time_Warning and Compile_Time_ Error to use statically known values of attributes 'Size and 'Alignment. For example: procedure do_test is generic type ParamType is private; package Gen is pragma Compile_Time_Error (ParamType'Size

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

Re: [Patch] Disable text mode translation in ada for Cygwin

2016-07-01 Thread Arnaud Charlet
> Text mode translation should not be done for Cygwin, especially since it > does not > support unicode setmode calls. This also fixes ada builds for Cygwin. > > OK for trunk? OK, thanks. >>> >>> Can someone please commit this? I don't have SVN write access. >>> >

[Ada] Early finalization of ctrl func result clobbers array element

2016-07-04 Thread Arnaud Charlet
This match modifies the expansion of array aggregates to perform in-place side effect removal when a controlled function call acts as an initialization expression. This eliminates the transient property of the function call and ensures the proper order of copy, adjustment, and finalization. --

[Ada] Confusing pragma unreferenced

2016-07-04 Thread Arnaud Charlet
Two pragmas exist - Unmodified and Unreferenced which issue warnings if the respective entities contained get written or read repectivly. Additionally, pragma Unreferenced will surpress compiler generated warnings for unread variables. However, this can lead to confusion about pragma Unreferenced w

[Ada] Use chained locations in GNATprove for inherited pre and post

2016-07-04 Thread Arnaud Charlet
When a class-wide pre- or postcondition is inherited by an overriding subprogram, the locations of the inherited pragma and of its expression are the same as the locations of the original pragma. This is inconvenient to distinguish properties proved on the overridden and the overriding subprograms.

[Ada] Spurious type errors because of views confusion in predicate functions

2016-07-04 Thread Arnaud Charlet
In the context of a predicate function the formal and the actual in a call may have different views of the same type, because of the delayed analysis of predicates aspects. This patch extends existing code that handles this discrepancy, to cover private and full views as well. Executing the follow

[Ada] Gnatfind crash on references to unknown files

2016-07-04 Thread Arnaud Charlet
This patch fixes an obscure bug in gnatfind that could cause it to crash on references to unknown files. The crash was caused by dereferencing an uninitialized pointer value, so it was flaky. No test is available. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-07-04 Bob Duff *

[Ada] Warning on fixed-point actual types with user-defined operators

2016-07-06 Thread Arnaud Charlet
This patch adds aa warning when a formal fixed point type is instantiated with a type that has a user-defined arithmetic operations, but the generic has no corresponding formal functions. This is worth a warning because of the special semantics of fixed-point operators, in particular multiplying op

[Ada] Spurious error on container instantiation with predicated array type

2016-07-06 Thread Arnaud Charlet
This patch fixes a spurious type error in a predicate function created within an operation in an instantiation of a container package, when the element type is an unconstrained array with a predicate. The following must compile quietly gcc -c gpr2-project-registry-attribute.adb --- with Ada.

[Ada] Missing abort deferral on controlled aggregate component assignment

2016-07-06 Thread Arnaud Charlet
This patch adds an abort defer / undefer pair around the initialization statements of a controlled aggregate component as dictated by 9.8 11. -- Source -- -- aggregates.ads with Ada.Finalization; use Ada.Finalization; package Aggregates is type Ctrl is new Controll

[Ada] Spurious error on withed Ghost unit

2016-07-06 Thread Arnaud Charlet
This patch modifies the front end to prevent the generation of ALI and object files as well as bypass the back end and suppress any errors related to code generation when the compilation unit is ignored Ghost. -- Source -- -- ignore.adc pragma Assertion_Policy (Ghost =

[Ada] Extra precision in the evaluation of non-static expressions

2016-07-06 Thread Arnaud Charlet
This patch prevents the use of arbitrary-precision computations when an expression consists of known numeric literals but one of them is not static by the rules of the language but happens to be known to the compiler through data-flow. The patch introduces a conversion to a machine number for the e

[Ada] Spurious errors on inherited class-wide preconditions

2016-07-07 Thread Arnaud Charlet
This patch fixes some spurious errors arising when class-wide preconditions in an generic instance are overridden in a child instance. The following must compile quietly: gcc -c r.ads --- generic package P is type T1 is abstract tagged private; procedure P1 (This : in out T1) with

[Ada] Clarify the semantics of -gnatn switch

2016-07-07 Thread Arnaud Charlet
This change is aimed at clarifying the semantics of the -gnatn switch, both in the code and in the documentation. In particular, it makes it explicit that -gnatn only pertains to inter-unit inlining (inlining across modules) and has no effect on intra-unit inlining (inlining within a given module)

Re: [patch] Get rid of stack trampolines for nested functions

2016-07-21 Thread Arnaud Charlet
Jeff, > So just to be clear, once installed, for Ada we'll start using the > descriptor based scheme on the subset of targets below, which will > be an ABI change, right? Right. > If so and this goes in, we'll have to make sure to signal loud and > wide about the ABI change at the project level

Re: [PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-07-30 Thread Arnaud Charlet
Frankly at this stage, I do not think it makes sense to maintain an Ada port for DJGPP and in particular maintain all these extra special cases and #ifdefs. How many users are we talking about here? Arno > This is first of 4 patches for DJGPP support of Ada compiler > > Patch adds support of ha

Re: [PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-07-31 Thread Arnaud Charlet
> > Frankly at this stage, I do not think it makes sense to maintain an > > Ada port for DJGPP and in particular maintain all these extra > > special cases and #ifdefs. > > I don't think this is a reasonable attitude to take with people who > are willing to do the work to do it. OK, let me reform

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 at

[Ada] Spurious End_Error with Get_Line on strings without line terminators

2016-04-27 Thread Arnaud Charlet
This patch fixes a spurious End_Error raised by Text_IO.Get_Line, when the input line has 499 or 500 characters and does not contain a line terminator. No short example available. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-27 Ed Schonberg * a-textio.adb (Get_Line funct

[Ada] Spurious dimensionality errors on multitidimensional aggregates.

2016-04-27 Thread Arnaud Charlet
This patch removes spurious dimensionality errors on aggregates for multi- dimensional arrays of scalar types with dimension specifications. Compiling dimbug.ads below must yield: dimbug.ads:8:33: dimensions mismatch in array aggregate dimbug.ads:8:33: expected dimension [L], found [M] ---

[Ada] Missing error on illegal use of volatile object

2016-04-27 Thread Arnaud Charlet
This patch updates the resolution of actual parameters to flags all effectively volatile objects with enabled property Async_Writers or Effective_Reads which appear in the actual as illegal because the context is interfering. -- Source -- -- volatiles.ads package Volat

[Ada] Missing error on classwide precondition on a generic subprogram

2016-04-27 Thread Arnaud Charlet
A generic subprogram is never a primitive operation, and thus a classwide condition for it is not legal. This patch diagnoses such an illegal class- wide condition properly. Example in ACATS test B611003 Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-27 Ed Schonberg * sem_

[Ada] Fix runtime build failure on vxworks 653 2.5

2016-04-27 Thread Arnaud Charlet
The current conditional compilation directives for vxworks lead to a call with a single argument on some versions, and to a call with two arguments on others. We currently end up in the single argument case for all versions of vxworks 653. This was fine for e.g. 2.2. This isn't fine any more with

[Ada] Crash on illegal use of limited view of type

2016-04-27 Thread Arnaud Charlet
This patch fixes a compiler abort on an illegal program that attempts to make use of the non-limited view of a type in the private part of a unit that has a limited_private with_clause on the unit that declared the type. Compiling unit_test05.adb must yield: unit_test05.ads:46:23: invalid use

[Ada] Incomplete xref information in ALI file

2016-04-27 Thread Arnaud Charlet
This patch fixes the handling of an object declaration whose type definition is a class-wide subtype and whose expression is a function call that returns a classwide type. Previous to this patch the type of the object in the ALI file appeared as the corresponding base type. Executing the following

[Ada] wrong interface type conversion of in-out parameter

2016-04-27 Thread Arnaud Charlet
The compiler silently skips generating the code to perform a type conversion when the all the following conditions occur: 1) the target type of the type conversion is an access to a class-wide interface type; 2) the type conversion is performed when passing an in-out access type actual to a subprog

[Ada] General handling of potential renamings in SPARK

2016-04-27 Thread Arnaud Charlet
This patch implements a mechanism for handling of renamings in SPARK. Since SPARK cannot handle this form of aliasing, a reference to a renamed object is replaced by a reference to the object itself. -- Source -- -- regpat.ads package Regpat is type Program_Data is

[Ada] Detect singular matrices in Solve primitives for vectors and matrices.

2016-04-27 Thread Arnaud Charlet
This patch detects cases when the determinant of a system of equations is exactly Zero, and raises the proper exception, as mandated by RN G.3.2 (68/2) and G.3.2 (89/2). Executing the following: gnatmake -q debug_solve.adb debug_solve must yield: System is: 1.0E+00 x_1 + 0.0E+00

[Ada] Spurious error on variable in private child package body

2016-04-27 Thread Arnaud Charlet
This patch modifies the contract freezing mechanism to suppress freezing when the trigger is the body of an instantiated package. This effectively prevents a spurious attempt to freeze because a) the body instantiation pass does not have all semantic information and b) freezing has already taken pl

[Ada] Informational messages that are not warnings

2016-04-27 Thread Arnaud Charlet
Previously, an informational message that was not a warning was treated as an error. This patch changes that, so such an informational message is not an error. There are no such messages in the compiler, so no test is available. This patch is mainly for use by SPARK, which wants to have information

<    5   6   7   8   9   10   11   12   13   14   >