Re: [PATCH] Spelling fixes - behaviour and neighbour

2016-02-12 Thread Arnaud Charlet
> While working on the -Waddress fix I've posted earlier today, I've noticed > that the C and C++ FE disagree on the spelling - C uses US english spelling, > while C++ uses UK english spelling. > This patch switches to US english spelling of these 2 words, in > diagnostics, documentation and commen

[Ada] Missing inlining of init_proc

2015-10-16 Thread Arnaud Charlet
The compiler may eventually silently skip inlining a non-tagged record type init proc because internally the frontend forgets to processing it. This issue generally does not occur since as soon as the frontend processes some unit that has pragma Inline the internal machinery which takes care of suc

update in Ada maintainers

2015-10-16 Thread Arnaud Charlet
front end Geert Bosch -Ada front end Robert Dewar -Ada front end Arnaud Charlet +Ada front end Arnaud Charlet Ada front end Eric Botcazou c++Jason Merrill

[Ada] Minimize the save/restore of Ghost_Mode

2015-10-16 Thread Arnaud Charlet
This patch minimizes the stack-like handling of global variable Ghost_Mode when processing Ghost code. The patch addresses references to Ghost entities within the expanded code for pragma Contract_Cases. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-16 Hristian Kirtchev *

[Ada] Improper initialization of elementary parameters in entry calls

2015-10-16 Thread Arnaud Charlet
The compiler was incorrectly default initializing entry call parameters in cases where the parameter is of an access type or of a scalar type whose Default_Value aspect is set. The access type case caused a problem for CodePeer in the case where the formal parameter is a null-excluding access type,

[Ada] Premature finalization leads to wrong short circuit result

2015-10-16 Thread Arnaud Charlet
This patch modifies the expansion of expression_with_actions nodes to force the evaluation of the expression when its type is Boolean. This prevents "leaks" of dependencies on transient controlled objects which lead to incorrect results in short circuit operators. -- Source -- ---

[Ada] Crash on illegal program with -gnatf.

2015-10-16 Thread Arnaud Charlet
This patch fixes a crash in the compiler when reporting an error on an illegal prefixed call whose prefix is overloaded, one of its interpretations has an untagged type, and All_Errors_Mode is set. No short example available. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-16 Ed Schon

[Ada] Optization of predicate checks

2015-10-16 Thread Arnaud Charlet
This patch marks the generated predicate functions as Pure, so that the back-end can optimize redundant calls to these functions when inlining and high level of optimization are requested. This is a performance enhancement, no change in behavior. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Cleanups in inter-unit inlining engine

2015-10-16 Thread Arnaud Charlet
This removes a component in the record attached to every subprogram considered for inter-unit inlining, which doesn't serve any useful purpose. In addition, this fixes a small inconsistency in the code driving inter-unit inlining from the front-end. The code was at the same time discarding the su

[Ada] Minor cleanup in finalization support of the runtime

2015-10-16 Thread Arnaud Charlet
This removes a couple of redundant/unused things. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-16 Eric Botcazou * a-tags.ads (Parent_Size): Remove obsolete pragma Export. * s-finmas.ads (Header_Offset): Delete. * s-finmas.adb (Heade

[Ada] Check suppression in Ada.Containers

2015-10-16 Thread Arnaud Charlet
This patch implements two new check names (Container_Checks and Tampering_Check) that may be used with pragma Suppress. Suppressing Tampering_Check suppresses checks for "tampering with cursors" and "tampering with elements". If pragma Suppress(Tampering_Check) is in force at the point of instantia

[Ada] Spurious error on SPARK_Mode in generic package instantiation

2015-10-16 Thread Arnaud Charlet
This patch modifies the generic instantiation to ensure that a context with a missing SPARK_Mode annotation is treated as having SPARK_Mode set to Off. This ensures that the following SPARK UG rule 9.4.1 Code where SPARK_Mode is Off shall not enclose code where Spark_Mode is On. However, if

[Ada] Pragma Constant_After_Elaboration

2015-10-16 Thread Arnaud Charlet
This patch implements the legality rules of pragma Constant_After_Elaboration: The Boolean aspect Constant_After_Elaboration may be specified as part of the declaration of a library level variable. The semantic checks of this annotation cannot be performed by the compiler as this requires f

[Ada] Pragma Constant_After_Elaboration

2015-10-20 Thread Arnaud Charlet
This patch allows for external tools that utilize the front end abstract syntax tree to querry for pragma Constant_After_Elaboration in the N_Contract node of a variable. No change in behavior, no need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Hristian Kirtchev

[Ada] Avoid overflow in Write_Int

2015-10-20 Thread Arnaud Charlet
This patch avoids an overflow on the most-negative number in Output.Write_Int. No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Bob Duff * output.adb (Write_Int): Work with negative numbers in order to avoid negating Int'First and thereby

[Ada] Do not inline No_Return procedures in GNATprove mode

2015-10-20 Thread Arnaud Charlet
Inlining in GNATprove mode is made to improve results of formal verification in GNATprove. It should not be done on procedures marked No_Return, which are handled specially in GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Yannick Moy * inline.adb (Can_Be_Inli

[Ada] Support for recording bind time environment info

2015-10-20 Thread Arnaud Charlet
This change adds support for recording a set of key=value pairs at the time an application is built (or more precisely at bind time), and making this information available at run time. Typical use case is to record a build timestamp: $ gnatmake record_build_time -bargs -VBUILD_TIME="`LANG=C date`"

[Ada] Improve error message for missing dependency item

2015-10-20 Thread Arnaud Charlet
This patch modifies the analysis of pragma Depends to emit a clearer message concerning a missing dependency item. -- Source -- -- message.ads package Message with Abstract_State => State, Initializes=> State, SPARK_Mode is procedure Proc (X : in

[Ada] Spurious error in instantiation of formal package with attribute

2015-10-20 Thread Arnaud Charlet
When verifying that a function that is an actual of a formal package matches the corresponding function in the corresponding actual package, functions given by attributes must be handled specially because each of them ends up renaming a different generated body, and we must check that the attribute

[Ada] Crash in compile-only mode with dynamic predicates.

2015-10-20 Thread Arnaud Charlet
This patch fixes a compiler abort on a program with a type that has defined dynamic predicate and a call to a procedure with a parameter of that type, when the program is compiled with -gnatc. The following must compile quietly: gcc -c -gnatc p-q.adb --- with Unchecked_Conversion; package P is

[Ada] Volatile functions

2015-10-20 Thread Arnaud Charlet
This patch implements SPARK volatile functions described by the following rules: A type is said to be effectively volatile if it is either a volatile type, an array type whose Volatile_Component aspect is True, or an array type whose component type is effectively volatile, a protected

[Ada] Uninitialized variable on illegal placement of aspect specification

2015-10-20 Thread Arnaud Charlet
This patch improves the handling of programs with illegal placement of aspect specifications, ensuring that the flag that controls the parsing of a list of declarations is properly set in the presence of errors. No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-

[Ada] Abort in front end client due to locked scope table

2015-10-20 Thread Arnaud Charlet
This patch reimplements the way the front end detects whether a type is a descendant of Ada.Synchronous_Task_Control.Suspension_Object to avoid using the RTSfind mechanism. This ensures that external clients of the front end will not fail due to a locked scope table accessed during analysis perform

[Ada] Better recovery for misplaced keyword in discriminant specification

2015-10-20 Thread Arnaud Charlet
This patch improves the handling of an error in a discriminant specification for an access discriminant. Compiling b.ads must yield: b.ads:3:43: "constant" must appear after "access" --- package B is type Constant_Reference (D : constant access Integer) is null record with Implici

[Ada] Abort while processing "of" container loop

2015-10-20 Thread Arnaud Charlet
This patch classifies an "of" loop parameter as never needing finalization actions. -- Source -- -- vectors.ads with Ada.Unchecked_Deallocation; with Ada.Unchecked_Conversion; with System; generic type Element_Type is private; Small_Vector_Capacity : Natural :=

[Ada] Discriminants and protected units

2015-10-20 Thread Arnaud Charlet
This patch implements the following SPARK RM rule: 7.1.3(5) - An effectively volatile type other than a protected type shall not have a discriminated part. -- Source -- -- discrims.ads package Discrims with SPARK_Mode is type Vol_1 (Discr : Natural) is null r

[Ada] Friendlier behavior for "=" and ":="

2015-10-20 Thread Arnaud Charlet
This patch avoids race conditions in certain cases. This is not necessary, because these cases are technically erroneous, but it seems friendlier to avoid races. Furthermore, previous versions of the containers avoided some of these races. No test available; no change in behavior for correct progr

[Ada] Remove UET_Address attribute

2015-10-20 Thread Arnaud Charlet
This was an unused and internal-use only attribute. No testcase. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Tristan Gingold * sem_util.adb (Is_Protected_Self_Reference): Remove reference to UET_Address in comment. * sem_attr.adb (Check_Unit_Name): Adj

[Ada] Debug information for limited class-wide objects

2015-10-20 Thread Arnaud Charlet
This patch modifies the expansion of a build-in-place function call that initializes a class-wide limited object to generate the necessary debug information for the object. -- Source -- -- types.ads package Types is type Root_Type is tagged limited record I :

[Ada] Crash on address clause involving controlled objects.

2015-10-20 Thread Arnaud Charlet
An address clause that overlays an object with a controlled object of a component of a controlled object is erroneous, and the compiler replaces the address clause with the corresponding raise statement. However, the analysis of the address clause must not terminate prematurely, so that the back-en

[Ada] Detection of lingering ignored Ghost code

2015-10-23 Thread Arnaud Charlet
This patch updates the generation of external symbol names to add a special prefix for ignored Ghost entities. The prefix aids in the detection of leaking ignored Ghost code in object/binary files. The reproducer showcases the usage. -- Source -- -- pack_pre.ads packag

[Ada] Unconstrained build-in-place return in block statement

2015-10-23 Thread Arnaud Charlet
For a build-in-place return of an unconstrained limited type (for example, a limited class-wide type), the result is returned on the secondary stack. This patch fixes a bug in the case where the return statement is inside a block statement nested inside the function, and that block uses the seconda

[Ada] Consistent setting of Pure flag on function with address parameters.

2015-10-23 Thread Arnaud Charlet
A subprogram that has an Address parameter and is declared in a Pure package is not considered Pure, because the parameter may be used as a pointer and the referenced data may change even if the address value itself does not. This check was previously performed only on the subprogram body, leading

[Ada] Instances of Ada.Unchecked_Conversion as volatile functions

2015-10-23 Thread Arnaud Charlet
This patch implements the following rule from the SPARK RM: 7.1.2 - (A protected function is also defined to be a volatile function,) as is an instance of Unchecked_Conversion where one or both of the actual Source and Target types are effectively volatile types. - -- Source

[Ada] Iterator subtypes

2015-10-23 Thread Arnaud Charlet
THis patch fixes an omission in the handling of iterators over containers. The code now handles properly an iterator type that is a subtype of the type obtained from an instantiation of the predefined iterator interfaces. Compiling and executing main.adb must yield: Element_T.F: 42 Element_T.F: 4

[Ada] Implement stack-checking on arm64-darwin.

2015-10-23 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-23 Tristan Gingold * init.c (__gnat_sigtramp): New assembly function for arm64-darwin. (__gnat_error_handler): Use trampoline for arm64. Index: init.c ===

[Ada] Spurious duplicate Default_Iterator error

2015-10-26 Thread Arnaud Charlet
This patch fixes a bug that caused the compiler to issue the error "default iterator must be unique" when one of the alleged "duplicates" is overridden by another. This can happen in cases involving types derived from types declared in generic formal packages. The error message (when it is correct)

[Ada] Expression functions, internal bodies and freezing of contracts

2015-10-26 Thread Arnaud Charlet
This patch ensures that only source package and subprogram bodies "freeze" the contract of the nearest enclosing package body. -- Source -- -- expr_funcs.ads package Expr_Funcs with SPARK_Mode, Abstract_State => State is Var_1 : Integer := 1; function I

[Ada] Missing error on conflicting declarations

2015-10-26 Thread Arnaud Charlet
With This patch the compiler properly rejects a subprogram body whose signature is type conformant with a previous expression function in the same scope. Compiling same_signature,adb must yield: same_signature.adb:8:04: body conflicts with expression function at line 5 --- with Ada.Text_IO; us

[Ada] SPARK_Mode on synchronized units and entry declarations

2015-10-26 Thread Arnaud Charlet
This patch implements the following semantic rules: The SPARK_Mode aspect can be used in the following places in the code: * on a library-level subprogram spec or body (which now includes entry declarations) * on a library-level task spec or body * on a library-level protected

[Ada] Local name hides global item

2015-10-26 Thread Arnaud Charlet
This patch modifies the analysis of pragmas Depends, Global, Refined_Depends and Refined_Global when they appear in a subprogram body. The pragmas are now analyzed immediately and in pairs. This preserves the inherent dependency of [Refined_]Depends on [Refined_]Global and prevents a visibility iss

[Ada] Pragma Volatile_Function has no effect on subprogram body

2015-10-26 Thread Arnaud Charlet
This patch modifies the analysis of pragmas that appear on package specs and and subprogram bodies. The new model of analysis allows for pragmas to appear out of order, but they are still analyzed according to internal precedence. The patch removes the restrictions concerning the declarations order

[Ada] Front-end inlining and predicates

2015-10-26 Thread Arnaud Charlet
The front-end cannot inline subprograms that contain certain declarations, such as nested subprograms. If the the subprogram to inline includes a subtype declaration with predicates, it cannot be inlined because the analysis of the predicate will generate (nested) predicate functions. Source: --

[Ada] Contracts on protected entries and task units

2015-10-26 Thread Arnaud Charlet
This patch implements pragmas [Refined_]Depends and [Refined_]Global on protected entries and task units. As a prerequisite, the patch implements aspect specifications on entry bodies as specified in Ada 2012 (AI12-0169): ENTRY_BODY ::= entry DEFINING_IDENTIFIER ENTRY_BODY_FORMAL_PART

[Ada] Spawning processes with no PATH

2015-10-26 Thread Arnaud Charlet
This patch fixes a bug in which GNAT.Expect.Non_Blocking_Spawn fails to find an executable when the PATH environment variable is not set. The executable should be found if it contains a directory name. The following test should execute quietly. gnatmake -q do_nothing.adb gnatmake -q spawn.adb uns

[Ada] Spurious errors with -gnatE and -gnatwl

2015-10-26 Thread Arnaud Charlet
This patch removes spurious errors triggered by the switches -gnatE (Dynamic elaboration) and -gnatwl (list elaboration warnings) when the elaboration call is appears in the prefix of an access attribute. Compiling gcc -c dds-translator.adb -gnatE -gnatwl must yield: dds-translator-genera

[Ada] Clean up in s-osinte

2015-10-26 Thread Arnaud Charlet
This patch cleans the way getpagesize() is imported and removes an inconsistency wrt the underlying C routine. No change in functionality. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-26 Arnaud Charlet * s-osinte-hpux.ads, s-osinte-aix.ads, s-osinte-solaris-posix.ads

[Ada] Overloaded indexing operations of a derived type

2015-10-26 Thread Arnaud Charlet
This patch fixes the handling of overloaded indexing operations that are inherited by a type derived from one that carries an indexing aspect. Source: --- with Ada.Text_Io; use Ada.Text_Io; with References; procedure Main is A : aliased References.Iterated; begin A (1) := 42; Put_Line ("A

[Ada] Extraction of components/discriminants of concurrent types

2015-10-26 Thread Arnaud Charlet
This patch allows First_Component and First_Component_Or_Discriminant to apply to protected and task types. No change in behavior, no test needed. The patch is aimed at clients of the compiler front-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-26 Hristian Kirtchev *

[Ada] In an element iterator, the element is constant if the container is.

2015-10-26 Thread Arnaud Charlet
This patch adds a legality check to element iterators over containers: the element is a constant if the container object is a constant, even if the container type has a Variable_Indexing aspect. Compiling the following must be rejected with: strange_behavior.adb:12:07: left hand side of assignme

[Ada] Restriction No_Dynamic_Sized_Objects

2015-10-26 Thread Arnaud Charlet
This patch implements a new restriction No_Dynamic_Sized_Objects, which is intended to prevent the creation of composite objects of non-static size. The following test should get an error. gcc -c dynamic_string.adb -gnatws dynamic_string.adb:4:18: violation of restriction "No_Dynamic_Sized_Object

[Ada] References to task and protected types in aspects/pragmas

2015-10-26 Thread Arnaud Charlet
This patch implements the following rules from SPARK RM 6.1.4: For purposes of the rules concerning the Global, Depends, Refined_Global, and Refined_Depends aspects, when any of these aspects are specified for a task unit the task unit's body is considered to be the body of a procedure

[Ada] Ghost types, objects and synchronization

2015-10-26 Thread Arnaud Charlet
This patch implements the following SPARK RM 6.9(19) rule: A ghost type shall not have a task or protected part. A ghost object shall not be of a type which yields synchronized objects. A ghost object shall not have a volatile part. A synchronized state abstraction shall not be a ghost

[Ada] Single protected declaration transformation guarantee

2015-10-26 Thread Arnaud Charlet
This patch adds a check to ensure that there is no attempt to expand a single protected declaration as the declaration should have been transformed into a protected type along with an anonymous object. No change in behavior, no test needed. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-1

[Ada] Renamings of volatile objects

2015-10-26 Thread Arnaud Charlet
This patch implements the following SPARK RM 7.1.3(12) rule: Contrary to the general SPARK 2014 rule that expression evaluation cannot have side effects, a read of an effectively volatile object with the properties Async_Writers or Effective_Reads set to True is considered to have an e

[Ada] Pragma SPARK_Mode and expression functions

2015-10-27 Thread Arnaud Charlet
This patch ensures that an internally generated subprogram body that completes an expression function inherits the SPARK_Mode from the expression function spec. -- Source -- -- expr_funcs.ads package Expr_Funcs with SPARK_Mode is function F1 return Boolean is (True)

[Ada] Delete response file even when link failed

2015-10-27 Thread Arnaud Charlet
When a response file was created and the link failed, the response file was not deleted. It is deleted now. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-27 Vincent Celier * gnatlink.adb: Always delete the response file, even when the invocation of gcc to link fail

[Ada] Legality checks on initialization of limited objects

2015-10-27 Thread Arnaud Charlet
This patch corrects an omission on the legality check for allocators with a qualified expression when the expression is of a limited type. The check must be performed after the expression is fully resolved, to handle properly complex overloading cases such as indexings of parameterless functions th

[Ada] Spurious error on legal use of abstract state constituent

2015-10-27 Thread Arnaud Charlet
This patch modifies the analysis of pragma Refined_Global to treat objects and states as constituents only when their encapsulating state appears in pragma Global. -- Source -- -- pack.ads package Pack with Abstract_State => (State1, State2), Initializes=>

Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads

2015-10-31 Thread Arnaud Charlet
> > This patch changes the Ada-declaration of the pthread-related structs > > such as pthread_attr_t from a field-equivalent declaration to just > > reserving the right amount of memory. > > It is only rtems related and essentially copies the way how the types are > > defined in s-osinte-linux.ads.

Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads

2015-11-02 Thread Arnaud Charlet
> Ok, I don't have time today. I will make a patch against trunk and will try > again with the correct format tomorrow. > How does the backporting work? > It's my first contribution to gcc, so bare with me ;-) See https://gcc.gnu.org/contribute.html for details. Arno

Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads

2015-11-03 Thread Arnaud Charlet
> Let's try again. This time I made the diff against trunk with the changes > Sebastian recommended, included a ChangeLog and used svn-diff. > If this patch goes through, please let me know how the backporting works. Your ChangeLog entry is not in the proper format, see sections 6.8.1 and 6.8.2 fr

Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads

2015-11-03 Thread Arnaud Charlet
> > Your ChangeLog entry is not in the proper format, see sections 6.8.1 and > > 6.8.2 from http://www.gnu.org/prep/standards/standards.html > > > > The diff itself is OK. > > Ok, fixed this. See the new diff below. This is now OK, you can go ahead and commit it. > > You can use svn merge to me

Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads

2015-11-04 Thread Arnaud Charlet
> > > > Your ChangeLog entry is not in the proper format, see sections 6.8.1 > > > > and > > > > 6.8.2 from http://www.gnu.org/prep/standards/standards.html > > > > > > > > The diff itself is OK. > > > > > > Ok, fixed this. See the new diff below. > > > > This is now OK, you can go ahead and com

Re: RFC: Experimental use of Sphinx for GCC documentation

2015-11-08 Thread Arnaud Charlet
We've switched the Ada doc to sphinx indeed, so can only be in favor of this change for the rest of GCC. We do have also a texi2rst script which handles 90% of the work, the rest requiring manual adaptations. I can send the script we've used if this can help. Arno

Re: RFC: Experimental use of Sphinx for GCC documentation

2015-11-09 Thread Arnaud Charlet
> > We do have also a texi2rst script which handles 90% of the work, the > > rest requiring manual adaptations. I can send the script we've used if > > this can help. > > I'm interested in seeing your script. Can you post/upload it somewhere? Yes I will. Let me get the latest version we've used

Re: RFC: Experimental use of Sphinx for GCC documentation

2015-11-09 Thread Arnaud Charlet
> > > We do have also a texi2rst script which handles 90% of the work, the > > > rest requiring manual adaptations. I can send the script we've used if > > > this can help. > > > > I'm interested in seeing your script. Can you post/upload it somewhere? > > Yes I will. Let me get the latest versi

Re: [PATCH] PR ada/66205 gnatbind generates invalid code when finalization is enabled in restricted runtime

2015-11-12 Thread Arnaud Charlet
> > This situation arises, for example, with an embedded RTS that > > incorporates the > > Ada 2012 generalized container iterators. > > I should add, this PR is the ???other half??? of PR ada/66242, which is fixed > in GCC 6; so please can it be reviewed? The proper patch for PR ada/66242 hasn't

[Ada] Warn when a non-imported constant overlays a constant

2015-11-12 Thread Arnaud Charlet
The compiler warns when a variable overlays a constant because of an address clause on the former. This change makes the compiler issue the same warning when a non-imported constant overlays a constant. The patch also removes an old pessimization whereby overlaid objects would be treated as volat

[Ada] More efficient code generated for object overlays

2015-11-12 Thread Arnaud Charlet
This change refines the use of the "volatile hammer" to implement the advice given in RM 13.3(19) by disabling it for object overlays altogether. relying instead on the ref-all aliasing property of reference types to achieve the desired effect. This will generate better code for object overlays, f

[Ada] Contract_Cases on entries

2015-11-12 Thread Arnaud Charlet
This patch implements apect/pragma Contract_Cases on enties. -- Source -- -- tracker.ads package Tracker is type Check_Kind is (Pre, Refined_Post, Post, Conseq_1, Conseq_2); type Tested_Array is array (Check_Kind) of Boolean; --

[Ada] Missing detection of elaboration dependency

2015-11-12 Thread Arnaud Charlet
This patch modifies the elaboration circuitry to detect an issue in SPARK where an object in package P of a private type in package T subject to pragma Default_Initial_Condition is default initialized and package P lacks Elaborate_All (T). -- Source -- -- pack.ads pack

[Ada] Legality checks on calls to a Generic_Dispatching_Constructor.

2015-11-12 Thread Arnaud Charlet
This patch adds several legality checks on calls to an instance of the predefined Generic_Dispatchin_Constructor. The following three tests are performed: a) The tag argument is defined, i.e. is not No_Tag. b) The tag is not that of an abstract type. c) The accessibility level of the type denot

[Ada] Obscure messages due to freezing of contracts

2015-11-12 Thread Arnaud Charlet
This patch classifies a misplaced constituent as a critical error and stops the compilation. This ensures that the missing link between a constituent and state will not cause obscure cascaded errors. -- Source -- -- pack.ads package Pack with Spark_Mode => On,

[Ada] Crash on inconsistent IF-expression

2015-11-12 Thread Arnaud Charlet
This change makes sure the compiler produces a proper error (rather than crash) when compiling an (illegal) IF-expression where THEN-expression is overloaded, and none of its interpretation is compatible with the ELSE-expression. The following compilation must display: $ gcc -c badelse.adb badels

[Ada] Crash on illegal selected component in synchronized body.

2015-11-12 Thread Arnaud Charlet
The prefix of a selected component in a synchronized body cannot denote a component of the synchronized type unless the prefix is an entity name. This was not properly rejected before. Compiling bakery.adb must yield: bakery.adb:44:35: invalid reference to internal operation of some object of

[Ada] Spurious visibility error with derivation and incomplete declaration

2015-11-12 Thread Arnaud Charlet
This patch fixes a spurious visibility error on an operator of a derived type, when the parent type is declared in another unit, and has an incomplete type declaration. The primitive operations of the derived types are to be found in the scope of its base type, and not in that of its ancestor. The

[Ada] Library-level error on aspects

2015-11-12 Thread Arnaud Charlet
This patch fixes a bug where GNAT fails to detect an error on an aspect that must be applied to a library-level entity. The following test must give an error: tls.adb:2:26: entity for aspect "Thread_Local_Storage" must be library level entity procedure Tls is V : Natural := 0 with Thread_Local

[Ada] housekeeping work in sigtramp.h

2015-11-13 Thread Arnaud Charlet
This adjusts various details in the header file. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11-13 Eric Botcazou * sigtramp.h: Fix formatting throughout, do not include other headers, add missing preprocessor condition and 'extern' keywords.

[Ada] Iterable aspect for an integer type

2015-11-13 Thread Arnaud Charlet
This patch fixes a spurious error on an iterator loop over an integer type on which the Iterable aspect has been specified. Analysis of the loop uses the base type to find the required primitive operations, but the signature of the First primitive and others uses the first subtype instead. Execut

[Ada] Handling of overloaded indexing functions

2015-11-13 Thread Arnaud Charlet
This patch completes the handling of generalized indexing in the presence of multiple indexing functions, when a derived type overrides inherited ones and defines new constant and variable indexing functions. Test in ACATS 4.0F C416A02 Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11-13

[Ada] Internal crash on illegal aspect Part_Of

2015-11-13 Thread Arnaud Charlet
This patch modifies the analysis of aspect specifications to continue the analysis after encountering an illegal aspect Part_Of. -- Source -- -- po_t.ads package PO_T is protected Prot_Typ is function Get return Integer; entry Set (X : Integer); priv

[Ada] PR ada/68345

2015-11-14 Thread Arnaud Charlet
This is a mechanical change made blindly since I do not have access to a dragonfly system. Should fix PR ada/68345. Committed on trunk. 2015-11-13 Arnaud Charlet PR ada/68345 * s-osinte-dragonfly.ads (Get_Page_Size): C function returns an int. -- Index: s-osinte

[Ada] Missing error on volatile return type of non-volatile function

2015-11-18 Thread Arnaud Charlet
This patch modifies the predicate which determines whether a function is volatile to correctly recognize a protected function. -- Source -- -- vol_func.ads package Vol_Func with SPARK_Mode is protected type Prot is end Prot; type Vol_Typ is null record with V

[Ada] Undefined symbols with pragma Initialize_Scalars

2015-11-18 Thread Arnaud Charlet
This patch modifies the generation of a constrained array subtype for an object declaration to use an external name. This ensures that a reference to the array subtype bounds are consistent when compiling with various switches and pragmas such as Initialize_Scalars. No simple reproducer possible.

[Ada] Malformed argument with pragma Refined_State

2015-11-18 Thread Arnaud Charlet
This patch modifies the grammars of pragmas Abstract_State, Depends, Global, Initializes, Refined_Depends, Refined_Global and Refined_State to explicitly request a single argument. No need for a test as this is a documentation enhancement. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11

[Ada] State refinement predicates for GNATprove

2015-11-18 Thread Arnaud Charlet
This patch implements two predicates that allow for state revinement queries while ignoring the region over which a state refinement is visible. No test possible as this requires an external client of the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11-18 Hristian Kirtchev

[Ada] Normalize_Pathname with unresolved reference directory

2015-11-18 Thread Arnaud Charlet
This change removes an unnecessary limitation whereby Normalize_Pathname would not accept an unresolved path name as the reference directory, and would furthermore return incorrect results, rather than an error diagnostic, in the case where input did not comply with this limitation. The following

[Ada] Crash on function returning limited view of class-wide type

2015-11-18 Thread Arnaud Charlet
THis patch fixes a compiler crash on a function that returns a class-wide type, when the type is first obtained by means of a limited view. The following must compile quietly: --- with New_Network; limited with New_Network.Bus; package Topology is type Vertex (Nb_Terminals : New_Network

[Ada] Spurious visibility error with private subtye, inlining and instance

2015-11-18 Thread Arnaud Charlet
This patch fixes an oversight in the restoring of proper use visibility on the full view of a private subtype, when a use clause for the enclosing package appears before an instantiation of a child unit of the package, the instantiation is followed by a use of the private subtype, and the compilati

[Ada] Better handling of invalid switches in GNAT.Command_Line

2015-11-18 Thread Arnaud Charlet
When the switch is ending with a '=', actual switches not followed with a space or '=' were raising Invalid_Parameter, which was mileading. This patch fixes this: exception Invalid_Switch is now raised and Full_Switch returns the full command line switch. Tested on x86_64-pc-linux-gnu, committed o

[Ada] PR ada/66242 Finalization with restriction No_Exception_Propagation

2015-11-18 Thread Arnaud Charlet
This patch adds abort defer / undefer pairs for partial finalization due to failed initialization and as part of unchecked deallocation actions. The patch also suppresses the generation of exception variables and handlers related to finalization actions when restriction No_Exception_Propagation is

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

2015-11-18 Thread Arnaud Charlet
This patch fixes a compiler crash on an attempt to assign to a record component whose type is the limited view of a classwide type. Compiling gcc -c c3a1004e.adb must yield: c3a1004e.adb:9:07: invalid use of limited view of "Department'CLASS" --- limited with C3A1004E; package C3A1004D i

[Ada] Concurrent constituents of a single protected/task type

2015-11-18 Thread Arnaud Charlet
This patch modifies the analysis of variable contracts to enforce the following SPARK RM rule: 9.3 - If a variable or a package which declares a state abstraction is declared immediately within the same declarative region as a single_task_declaration or a single_protected_declaration, the

[Ada] Freezing of contracts, Part_Of and current instance of a concurrent type

2015-11-18 Thread Arnaud Charlet
This patch addresses several areas: The freezing of contracts has been enhanced. A body continues to freeze the contract of the nearest enclosing package and now freezes the contracts of all eligible constructs in the same declarative list that precede the body. A concurrent constituent is no lon

[Ada] Make System.String_Hash available through GNAT.String_Hash

2015-11-18 Thread Arnaud Charlet
System.String_Hash provides a generic hash function that can be generally useful outside standard containers. This change make it available for users through a new renaming package: GNAT.String_Hash. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11-18 Pierre-Marie de Rodat *

[Ada] Crahs on indexing operation with named associations

2015-11-18 Thread Arnaud Charlet
This patch fixes a crash on a variable indexing operation appearing on the left-hand side of an assignment, when the index expressions are given by parameter associations. The following must compile quietly: gcc -c -gnatct test_indexing.adb --- with Ada.Text_IO; use Ada.Text_IO; with Project;

Re: Fix lto-symtab ICE during Ada LTO bootstrap

2015-11-22 Thread Arnaud Charlet
> > ../../gcc/ada/s-os_lib.adb:1007:16: note: return value type > > mismatch > >function strerror (errnum : Integer) return System.Address; > > ^ > > > > ../../gcc/ada/s-os_lib.adb:1007:16: note: > > ???system__os_lib__errno_message__strerror??? was previously > > declared

Re: Fix lto-symtab ICE during Ada LTO bootstrap

2015-11-23 Thread Arnaud Charlet
> I updated the warning to actually check if the TBAA information is in > conflict > and silence warnings on allowed type transtions that are not > useless_type_conversion_p > (which is needed for Fortran, too). This is list of warnings I get which I > suppose will need to be adressed. Most if not

Re: Fix lto-symtab ICE during Ada LTO bootstrap

2015-11-23 Thread Arnaud Charlet
> > So there is indeed no point in trying to fix one or two cases, and we should > > instead instruct LTO somehow to treat System.Address is compatible with > > void* otherwise we'll run into endless troubles on that since using > > System.Address as void* is very common practice in Ada code. > >

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