[Ada] Excluded checked on unchecked unions

2014-07-31 Thread Arnaud Charlet
Checks that would read the value of a discriminant are suppressed on types that are unchecked unions. If such a record has components whose types have invariants, applying those checks would require determining the variant in which they reside, and this cannot be done on an unchecked union. THis pa

[Ada] Correct failure to detect Invariant'Class for untagged type

2014-07-31 Thread Arnaud Charlet
This fixes a problem with B test ND11001. There were actually three problems reported a) Bad use of Default_Component_Value, but this had already been previously fixed. b) Bad use of Invariant'Class, fixed as part of this patch c) Failure to detect bad aspect on null body. This was actually an i

[Ada] Overflow checking is now on by default

2014-07-31 Thread Arnaud Charlet
All previous versions of GNAT have set overflow checking off by default (with -gnato switches to enable overflow checking). This update sets the default to checking on, and implements a new switch -gnato0 to turn overflow checking on. The old switch -gnato, which used to enable overflow checking ca

[Ada] Do not fail program when runtime dir cannot be found

2014-07-31 Thread Arnaud Charlet
When a runtime specified as a relative or full path in package Builder of the main project, instead of failing the program immediately, the Project Manager raises an exception. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-31 Vincent Celier * prj-pars.adb, prj-conf.ads, pr

[Ada] Crash on complex conditional involving a packed array indexing

2014-07-31 Thread Arnaud Charlet
This patch updates the freezing of expressions to account for a case when the freezing expression is part of the Actions list of a N_Expression_With_Actions node. In this case, any freeze nodes must remain in the Actions list. -- Source -- -- use_before_decl.adb with A

[Ada] More precise setting of Do_Overflow_Check flag for division

2014-07-31 Thread Arnaud Charlet
The Do_Overflow_Check flag was being set on division operators in many cases where it was not needed. Now the flag will be set only if there is a possibility of the (largest neg number) / (-1) case and this only if code is not being generated (-gnatc mode), since if code is generated, the check is

[Ada] Interplay between limited with clauses, abstract states and refinement

2014-07-31 Thread Arnaud Charlet
This patch corrects the mechanism which handles limited with clauses to semi- declare abstract states (the states are fully declared when Abstract_States is analyzed). The end result is that multiple limited with clauses now reference one unique entity which denotes the state. -- Sour

[Ada] Handle =>+ notation for Depends pragma/aspect

2014-07-31 Thread Arnaud Charlet
The Depends pragma/aspect uses + in a non-standard manner, which requires new handling for the -gnatyt token check, as shown by this test, compiled with -gnatl -gnatyt 1. package DependsStyle is 2.procedure P1 3. (A : in out Integer; B : Integer) 4. with Depends =

[Ada] Crash on illegal discrete range

2014-07-31 Thread Arnaud Charlet
With this patch the compiler rejects properly a discrete range in a loop specification that uses 'length by mistake. Compiler lab4.adb must yield: lab4.adb:13:23: expect attribute "range" --- package body lab4 is procedure createArray (myArr : in out dynArray; maxIndex : Integer) is

[Ada] Warnings on non-static components of protected types

2014-07-31 Thread Arnaud Charlet
This patch improves the warnings on component of protected types when compiled under restriction No_Heap_allocations. The patch distinguishes betwen: a) components whose size depends on discriminants, in which case an object of the type will not violate restriction if the discriminants have stati

[Ada] Avoid random warnings treated as errors

2014-07-31 Thread Arnaud Charlet
There may be cases when warnings in the Project Manager are treated as errors, even when the switch -we is not used. There is no test, as the occurences of such errors are random (unitialized component of a record). Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-31 Vincent Celier

[Ada] Legality checks on indexing aspects

2014-07-31 Thread Arnaud Charlet
This patch implements the legality rules given in RM 4.1.6 on user-defined indexing, most importantly the rule that the aspects cannot be specified for a derived type if the parent type has such defined or inherited aspects. Several reports include this illegal usage, which appears to be an intui

[Ada] Avoid unwanted overflow checks on unconstraint float operations

2014-07-31 Thread Arnaud Charlet
For operations on unconstrained floating-point values, we do not want overflow checks (since we expect to generate and handle IEEE INF and NaN values). This corrects a problem where such checks were being set if integer overflow was enabled. The following test when executed: 1. with Ada.Float

[Ada] SPARK property "effectively volatile" and its effects

2014-07-31 Thread Arnaud Charlet
This patch implements SPARK property "effectively volatile" which states: In SPARK 2014, the terms volatile type and volatile object are defined as per Ada RM C.6(8/3). An effectively volatile type is a volatile type or an array type to which the Volatile_Components aspect has been applie

[Ada] Add support for files > 2Gb on 32bit platforms.

2014-07-31 Thread Arnaud Charlet
This patch set adds support for file larger than 2Gb on 32bit platforms. The main visible change is that Stream_Element_Offset is now a 64bit type on all platforms. The other changes are internal only. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-31 Pascal Obry * a-stream

[Ada] Remove -gnatdm flag

2014-07-31 Thread Arnaud Charlet
As a first step in removing specific support for the no-longer supported VMS port of GNAT, this patch removes the -gnatdm flag which allowed testing of VMS-specific tests on non-VMS platforms. The test suite has been adjusted appropriately, no additional test is required. Tested on x86_64-pc-linux

[Ada] Remove VMS specific files

2014-07-31 Thread Arnaud Charlet
This is part of the Ada front-end clean ups related to the removal of VMS support. More changes to come. Note: I've removed the boring deletions from the diff. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-07-31 Arnaud Charlet * s-auxdec-vms-ia64.adb, s-parame-vms-alph

[Ada] Remove VMS handling in most tools

2014-08-01 Thread Arnaud Charlet
Continuation of VMS removal in the GNAT front-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-01 Arnaud Charlet * binde.adb, bindgen.adb, butil.adb, clean.adb, gnatbind.adb, gnatchop.adb, gnatcmd.adb, gnatls.adb, gnatname.adb, krunch.adb, make.adb

[Ada] More VMS clean ups

2014-08-01 Thread Arnaud Charlet
In various parts of the front-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-01 Robert Dewar * inline.adb, inline.ads, fe.h, einfo.adb, einfo.ads, sem_util.adb, sem_util.ads, exp_ch4.adb, exp_ch11.adb, exp_ch6.adb, cstand.adb, sem_mech.adb, sem_ch6.adb,

[Ada] Remove xgnatugn in doc generation

2014-08-01 Thread Arnaud Charlet
removes the preprocessing step needed to generate gnat_ugn.info. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-01 Arnaud Charlet * ug_words, xgnatugn.adb, gcc-interface/Make-lang.in: Remove xgnatugn.adb and ug_words. Index: ug_words

[Ada] Generate Machine, Model and Rounding FP attributes in line

2014-08-01 Thread Arnaud Charlet
This change makes it so that the Machine, Model and Rounding FP attributes are generated in line by the compiler (in conjunction with a conversion to an integer type for the third) and optimized on architectures that do not make use of internal extended precision in the FPU. The following function

[Ada] Improve messages for lack of inlining in GNATprove mode

2014-08-01 Thread Arnaud Charlet
Expression functions with a separate declarations should never be inlined in GNATprove mode, hence no message should be issued for these. Correct a problem in call resolution which lead to such a message. Also change the message for lack of inlining in GNATprove mode, so that an info message is iss

[Ada] Legality checks involving aspect Import

2014-08-01 Thread Arnaud Charlet
This patch adds some missing legality checks on uses of aspect Import. These checks were performed properly in the presence of pragmas, but were incomplete when using aspects. Compiling q.ads must yield: q.ads:2:28: imported entities cannot have explicit initialization (RM 8.1 (24)) q.ads:6:24: n

[Ada] Add support for non-capturing parenthesis in GNAT.Regpat

2014-08-01 Thread Arnaud Charlet
It is now possible to use the (?:...) syntax to group elements in a regular expression without making their matched substring available in the Match_Array. The following test must output: Matched (0)= 1.. 6 Matched (1)= 5.. 5 Matched (2)= 0.. 0 with GNAT.Regpat; use GNAT.Regpat;

[Ada] Spurious warning on generated with_clause for renamed unit

2014-08-01 Thread Arnaud Charlet
This patch suppresses spurious warnings that may be generated when the prefix of a with_clause for a child unit denotes the renaming of a parent unit. Such renamings generate internal with_clauses that are not marked Implicit_With because they must be properly installed as part of the context, but

[Ada] Conformance checking in instantiations

2014-08-01 Thread Arnaud Charlet
Within an instance, a subprogram declaration and the corresponding body may be fully conformant, but one may use in its profile a formal type while the other uses a declared subtype of that formal. The routine Same_Generic_Actual is used to recognize this case and prevent a spurious conformance err

Re: [Ada] Don't unconditionally define _LARGEFILE_SOURCE

2014-08-01 Thread Arnaud Charlet
> 2014-08-01 Pascal Obry > > * cstreams.c: Only enable large file support on know supported > platforms. Add missing defines/includes. > > broke Ada bootstrap on Solaris: > > /vol/gcc/src/hg/trunk/local/gcc/ada/cstreams.c:34:0: error: > "_LARGEFILE_SOURCE" redefined [-Werror]

[Ada] Give missing entity messages in -gnatc mode

2014-08-01 Thread Arnaud Charlet
This patch forces expansion on (but not actual code generation) for configurable run time mode or no run time mode in -gnatc mode. This means that we get error messages about unsupported features even in -gnatc mode, which was not true before. The following is compiled in -gnatc mode with a gnat.ad

[Ada] Improved handling of info messages

2014-08-01 Thread Arnaud Charlet
The count of info messages is now separated from the count of warnings and -gnatwe never turns info messages into errors. The following compiles as shown, and generates object code since no error is found when compilation options -gnatwe -gnatld7 -gnatj55 are used. Compiling: infoerr.adb 1.

[Ada] Parameterless calls to protected operations on selected components.

2014-08-01 Thread Arnaud Charlet
A multi-level selected component can designate a call to a parameterless protected operation whose target object is itself given by a selected component. When the node is rewritten as a function call, it is necessary to preserve the tree structure of the name, so that overload information and subse

[Ada] Crash on entry call with preconditions and access parameters

2014-08-01 Thread Arnaud Charlet
When an entry has preconditions, the entry call is wrapped in a procedure call that incorporates the precondition checks. To prevent a double expansion, with possible duplication of extra formals, that procedure call must only be pre- nalyzed and resolved. Expansion takes place upon return to the c

[Ada] Access types that designate limited views of types with tasks.

2014-08-01 Thread Arnaud Charlet
This patch fixes the handling of access types whose designated types are limited views of untagged types with tasks. executing the following: gnatmake -q main.adb main must yield: Task started Task started --- with Package_Common; use Package_Common; with Package_A; use Package_A;

[Ada] Minor internal cleanup

2014-08-01 Thread Arnaud Charlet
Underlying_Type now recursively goes down the chain of private derivations, including the Underlying_Full_View if any, so we call it instead of making the descent manually in Build_Initialization_Call. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-01 Eric Botc

[Ada] Crash on generic instance with class-wide actual

2014-08-01 Thread Arnaud Charlet
This patch reimplements part of the support for AI05-0071 which deals with generic/instance scenarios involving a formal type with unknown discriminants, a generic primitive operation of the formal type declared with a box and an actual class-wide type. -- Source -- --

[Ada] Fix breach of privacy with type derived from private discriminated

2014-08-01 Thread Arnaud Charlet
This fixes a breach of privacy for types derived from private discriminated record types whose full view has no discriminants, as well as factors out the code doing the full derivation in the various cases into a single child procedure of Build_Derived_Private_Type. As a consequence, this removes

Re: [Ada] Remove xgnatugn in doc generation

2014-08-01 Thread Arnaud Charlet
> > 2014-08-01 Arnaud Charlet > > > > * ug_words, xgnatugn.adb, gcc-interface/Make-lang.in: Remove > > xgnatugn.adb and ug_words. > > Could you check if this needs any changes to the support in > update_web_docs_svn for generating the online manuals,

[Ada] Equality and class-wide instantiations with a defaulted equality

2014-08-04 Thread Arnaud Charlet
This patch modifies the implementation of AI05-0071 to allow several special cases of equality to appear in instantiations where a formal type has unknown discriminants, a defaulted equality and the actual type is class-wide. -- Source -- -- equals_gen.ads generic t

[Ada] Wrong source locations in the profile of an instantiated subprogram

2014-08-04 Thread Arnaud Charlet
This patch modifies the formal subprogram instantiation machinery to preserve the source locations of all formal parameters when creating the corresponding renaming declaration. No reproducer as this requires ASIS. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-04 Hristian Kirtchev

[Ada] Remove unnecessary range checks

2014-08-04 Thread Arnaud Charlet
This change removes some unnecessary range checks. The following test compiled with -gnatdt -gnatc: 1. procedure RCInteger (X : Integer) is 2.type YT is new Integer; 3.Y : constant YT := YT(X) * YT(X); 4. begin 5.null; 6. end; generates a tree file that h

[Ada] Reject illegal use of 'Old in complex postcondition.

2014-08-04 Thread Arnaud Charlet
A postcondition whose expression is a short-circuit is broken down into individual aspects in order to provide better exception reporting. This transformation is performed syntactically, before any analysis. The original short-circuit expression is rewritten as its second operand, and an occurrence

[Ada] Make sure that range check flag is set on real-integer conversions

2014-08-04 Thread Arnaud Charlet
This change makes sure that the Do_Range_Check flag is set in -gnatc or GNATprove mode for type conversions from real to integer. This makes sure that SPARK2014 programs properly verify that such conversions cannot raise an exception due to an out of range value. The following test compiled with -g

[Ada] New defaults for some project attributes

2014-08-04 Thread Arnaud Charlet
Some of the project attributes have new defaults that are no longer the empty string of the empty string list. These defaults are used as values of attribute references when the attribute has not been declared. Object_Dir has as default ".". Exec_Dir has as default Object_Dir, as previously specifi

[Ada] Apply special expansion in GNATprove mode also for pre-analysis

2014-08-04 Thread Arnaud Charlet
Some expression are only pre-analyzed in GNATprove mode, like default expressions and assertions. These also need to be light-expanded for formal verification. This is the second commit attempt, as the first one failed to build GNAT due to a bug. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Type invariant procedure called on an uninitialized object

2014-08-04 Thread Arnaud Charlet
The compiler can generate a call to a type's invariant-checking procedure on an uninitialized object, such as a temporary object created for holding an aggregate. This is prevented by inhibiting the call when No_Initialization is set on the object. The following test must compile and execute quiet

[Ada] Aspect/pragma Default_Initial_Condition

2014-08-04 Thread Arnaud Charlet
This patch implements aspect/pragma Default_Initial_Condition. The construct has the following semantics and runtime behavior: The Default_Initial_Condition aspect is introduced by an aspect_specification where the aspect_mark is Default_Initial_Condition. The aspect may be specified only as part

[Ada] Make sure Do_Range_Check flag is set when needed on OUT parameter

2014-08-04 Thread Arnaud Charlet
In -gnatc or GNATprove mode, there were cases in which the Do_Range_Check flag was not set on an OUT parameter, causing e.g. GNAT prove to miss the requirement for proving that an out parameter result was in range. This is now corrected, the following test, compiled in -gnatd.F (GNATprove mode) wi

[Ada] Freezing subprogram that returns a limited view

2014-08-04 Thread Arnaud Charlet
This patch handles properly a function declared in package A that returns the limited view of a type declared in package B, when the function is called from a context that has with_clauses on A and B. Previous to this patch such a call would crash the compiler because of a misplaced freeze node. T

[Ada] Aspect Import with a value of False

2014-08-04 Thread Arnaud Charlet
In Ada 2012, boolean aspects are True by default, but can specify explicitly a value of False. In the case of an Import aspect, this indicates that the corresponding entity must have a completion in Ada, and not in the language specified in a Convention aspect. Compiling main.adb must yield:

[Ada] Add documentation for aspect Invariant'Class

2014-08-04 Thread Arnaud Charlet
Documentation change only, no test required Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-04 Robert Dewar * gnat_rm.texi: Add section on aspect Invariant'Class. Index: gnat_rm.texi === --- gnat_rm.texi

[Ada] Crash on entry call with limited view of synchronized object

2014-08-04 Thread Arnaud Charlet
The prefix of an entry call may be a limited view, in which case the expansion of the call must use the non-limited view, which is available at the point of an entry call. The following must compile quietly: gcc -c railway-train.adb --- package Railway is end Railway; --- limited with Railway

[Ada] Aspect/pragma SPARK_Mode in generic

2014-08-04 Thread Arnaud Charlet
This patch allows the uses of aspect/pragma SPARK_Mode in generic units. It also implements the following rule concerning the interplay between instances and SPARK_Mode "off": However, if an instance of a generic unit is enclosed by code where SPARK_Mode is Off and if any SPARK_Mode specific

[Ada] Use of discriminants in derived types for SPARK 2014

2014-08-04 Thread Arnaud Charlet
This patch implements the following rules related to the discriminants of derived types: The type of a discriminant_specification shall be discrete. A discriminant_specification shall not occur as part of a derived type declaration whose parent type is discriminated. -- Sou

[Ada] Support for hash based message authentication codes

2014-08-04 Thread Arnaud Charlet
This change introduces a new subprogram in the GNAT secure hash framework to allow computing HMACs based on the secure hash functions. This is achieved by initializing a context with a (non-empty) key. The following example shows how to compute the first HMAC-MD5 test from RFC2104: $ gnatmake -q

[Ada] Spurious elaboration warning on added postcondition call

2014-08-04 Thread Arnaud Charlet
This patch removes a spurious elaboration warning on some calls to postconditions. Such a call always appears within an enclosing body, and as such is not subject to an elaboration check, but the call that is inserted after the final (inserted) return statement in a procedure body is analyzed in th

[Ada] Add internal abstraction for standard string test

2014-08-04 Thread Arnaud Charlet
This adds an internal abstraction for testing for standard string types. Internal front end cleanup, no function effect, no test required. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-04 Robert Dewar * einfo.ads, einfo.adb (Is_Standard_String_Type): New function.

[Ada] PR ada/60411

2014-03-07 Thread Arnaud Charlet
This change enables ZCX on armel linux, and should fix PR ada/60411, at least for the native part reported in comment #1 PR ada/60411 * system-linux-armel.ads (Backend_Overflow_Checks): Set to True. (Support_64_Bit_Divides): Removed, no longer used. (ZCX_By_Defau

Re: Please revert the patches in bug #54040 and #59346 and special case x32

2014-04-09 Thread Arnaud Charlet
> What do you think, Arno? I think that the POSIX breakage (and its fallout for > the other Unices) is ugly and worth the additional complication. Yes, your patch looks good to me. Arno

Re: [RFC] Add aarch64 support for ada

2014-04-16 Thread Arnaud Charlet
The Makfile.in and init.c changes are OK. The types.h change is likely more controversial and may be problematic, I'll let Eric comment. > + system.ads > IMO, this should really be called system-linux-lp64.ads, and should > be usable for any 64-bit target that uses full ieee floating point, > w

[Ada] gnatmake -s -fstack-check

2013-01-02 Thread Arnaud Charlet
As -fstack-check is an alias for -fstack-check=specific and the longer switch is now recorded in the ALI file, this patch make sure that when -fstack-check is used, gnatmake -s will no longer recompiles all the sources. The test for this is to invoke several time gnatmake -s -fstack-check on the sa

[Ada] Convention for operations of generlc formals with unknown discriminants

2013-01-02 Thread Arnaud Charlet
RM 6.3.1 (8) specifies that the operations inherited by a generic formal tagged derived type with unknown discriminants have convention Intrinsic. As a consequence, attribute 'Access cannot be applied to suvh an operation. This rule also makes it impossible to override an inherited operation of a

[Ada] Preconditions and postconditions on subprogram bodies

2013-01-02 Thread Arnaud Charlet
This patch implements properly pre- and postconditions that are given in subprogram bodies that have no previous specification. Executing: gnatmake -q -gnat12a pre_on_baas pre_on_baas must yield: before P called after -- pragma Ada_2012; pragma Check_Policy (Precondition, Check); with Ad

[Ada] Debug information for code generated for pragma Check

2013-01-02 Thread Arnaud Charlet
This change corrects an anomaly in the source locations produced in debug information for code implementing a pragma Check that could cause incorrect coverage analyses. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-02 Thomas Quinot * exp_prag.adb (Expand_Pragma_Check): The

[Ada] A prefixed view of a subprogram has convention Intrinsic

2013-01-02 Thread Arnaud Charlet
This patch enforces the rule given in 6.3.1 (10.1/2): a prefixed view of a subprogram is intrinsic, because the compiler has to generate a wrapper for any call to it. If the name in a subprogram renaming is a prefixed view, the entity is thus intrinsic, and 'Access cannot be applied to it. Compili

[Ada] Wrong evaluation order for AND THEN in Pre/Post on library subprogram

2013-01-02 Thread Arnaud Charlet
This change fixes the circuitry that processes Pre/Post aspects. Previously when an AND THEN expression was used in such an aspect on a library level subprogram, the operands would be evaluated in the wrong order. Test case: $ gnatmake -q call_p $ ./call_p F( 1) -> TRUE F( 2) -> TRUE P called F(

[Ada] Implement tagging of warning messages

2013-01-02 Thread Arnaud Charlet
This patch implements the -gnatw.d switch to activate tagging of warning messages. With this switch set, warning messages will have a tag at the end which is one of: [-gnatw?] ? in a .. z [-gnatw.?] ? in a .. z [enabled by default] So, similar to the tags emitt

[Ada] Implement pragma Check_Float_Overflow

2013-01-02 Thread Arnaud Charlet
On most targets, Machine_Overflows is false for built in floating-point types, and unconstrained floating-point types like Float do not raise an exception on overflow, instead they generate infinities or in some cases, NaN's. Check_Float_Overflow is a configuration pragma that sets a mode in which

[Ada] Illegal forward reference in pragma Postcondition

2013-01-02 Thread Arnaud Charlet
This patch ensures that the boolean expression of pragma Postcondition is preanalyzed at the point of declaration when the pragma appears inside a subprogram body. -- Source -- -- main.adb procedure Main is pragma Postcondition (X'Old = 1); X : Integer := 0; begi

[Ada] Improvements to sprint for conditional expressions

2013-01-02 Thread Arnaud Charlet
This change improves the circuitry that produces a source-like rendition for an Ada tree by omitting the generation of extraneous parentheses around conditional expressions, and removing an extraneous ELSE keyword. The following compilation must produce the indicated output: $ gcc -c -gnat12 -gnat

[Ada] Make {Short,Long,Long_Long}_Complex_Elementary_Functions pure

2013-01-02 Thread Arnaud Charlet
The other Complex_Elementary_Functions packages were already declared pure, these were missed by oversight. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-02 Geert Bosch * a-nllcef.ads, a-nlcefu.ads, a-nscefu.ads: Make Pure. Index: a-nllcef.ads

[Ada] Illegal prefix in array attributes

2013-01-02 Thread Arnaud Charlet
A reference to a type in an expression freezes the type, and any component subtypes. This is the case for array attributes such as 'Length, 'Size, etc. which can be evaluated without reference to the component type, but still require that the component type be fully declared at the point of the att

[Ada] Class-wide objects and debugging information

2013-01-03 Thread Arnaud Charlet
If an object has a class-wide type and a renaming declaration is created for it, the original object and the one in the renaming declaration are exchanged so that source information is consistent. The exchange must preserve the entity chain, which already contains generated internal types. This ens

[Ada] Wrong visibility for root library unit

2013-01-03 Thread Arnaud Charlet
This change fixes a defect in the visibility rules whereby a root library unit that appears indirectly in the closure is erroneously treated as visible if referred to using an expanded name with prefix Standard. Root library units must be treated no different than child units for visibility purpose

[Ada] gnatfind missing references to array types

2013-01-03 Thread Arnaud Charlet
The format for the ALI file has evolved and now lists the information for both the index and the component type for array types. However, gnatfind and gnatxref do not correctly parse this information and consider the corresponding line as invalid, resulting in missing references. With the followin

[Ada] 2012 rule on aliasing

2013-01-03 Thread Arnaud Charlet
Ongoing work to implement AI05-0144. No test needed. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-03 Javier Miranda * sem_warn.adb (Warn_On_Overlapping_Actuals): Adding documentation plus restricting the functionality of this routine to cover the cases des

[Ada] Incorrect attachment point for address clause alignment check

2013-01-03 Thread Arnaud Charlet
The alignment check for an address clause must be inserted after the object has been elaborated in the GIGI sense, but before any initialization operation occur. This change fixes both the spec and implementation of Apply_Address_Clause_Check to this effect (previously they disagreed, and were both

[Ada] GNAT driver with a project file and a single main - switches

2013-01-03 Thread Arnaud Charlet
When the GNAT driver is called with a project file and a single main specified as an absolute path, the specific switches that are declared for the main source were not taken into account. This patch fixes this. The specific switches are now taken into account. Example: prj.gpr: project Prj is

[Ada] 2012 rule on aliasing

2013-01-03 Thread Arnaud Charlet
Ongoing work to implement AI05-0144. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-03 Javier Miranda * sem_warn.adb (Warn_On_Overlapping_Actuals): For overlapping parameters that are record types or array types generate warnings only compiling under -gnatw.

[Ada] Illegal component clause for inherited component in extension

2013-01-03 Thread Arnaud Charlet
This change fixes the circuitry that handles record representation clauses so that a component clause for an inherited component in a record extension is properly rejected (such a clause is illegal per 13.5.1(9)). The following compilation must be rejected with the indicated error: $ gcc -c illega

[Ada] Aspect Abstract_State

2013-01-03 Thread Arnaud Charlet
This patch provides the initial implementation of aspect Abstract_State. This construct is intended for formal verification proofs. The syntax of the aspect is as follows: abstract_state_list::= null | state_name_with_properties | (state_name_with_properties { , state

[Ada] Avoid overflow in Table reallocation

2013-01-03 Thread Arnaud Charlet
This patch avoids an overflow that occurs when tables get bigger than about 12 million elements. No change in functionality (except for enormous tables), so no test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-03 Bob Duff * table.adb (Reallocate): Calculate new

[Ada] Attribute Loop_Entry and index check generation

2013-01-04 Thread Arnaud Charlet
This patch delays the generation of index checks for the following cases of Loop_Entry attribute references: Prefix'Loop_Entry (Expr) Prefix'Loop_Entry (Expr1, Expr2, ... ExprN) Even though these constructs appear initially as attribute references, analysis converts them into indexed compon

[Ada] Aspect Global

2013-01-04 Thread Arnaud Charlet
This patch provides the initial implementation of aspect Global. This construct is intended for formal verification proofs. The syntax of the aspect is as follows: global_specification ::= (moded_global_list {, moded_global_list}) | global_list

[Ada] Better error message for aspect specification without Ada 2012 mode

2013-01-04 Thread Arnaud Charlet
This patch improves the error message when compiling a unit with an aspect specification in an older Ada mode, and the first aspect specification is for a boolean aspect whose value is defaulted. Compiling the following: gcc -c r1.ads must yield: r1.ads:2:16: aspect specification is an Ad

[Ada] Follow on work for tagging of warning switches

2013-01-04 Thread Arnaud Charlet
Correct some missing cases of setting this switch, document it in usage. Primarily documentation, so no new test needed. Also makes clear that this switch is not available in VMS. No test needed. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-04 Robert Dewar * gnat_ugn.texi

[Ada] Internal fix to Insert_Actions routine in compiler

2013-01-04 Thread Arnaud Charlet
This patch corrects an obvious latent bug in Insert_Actions, namely that in the case of an expression with actions node, the actions were inserted in reverse order from the calls. As far as we know, this bug is only latent (found from code reading), so no test is required for this fix. Tested on x

[Ada] Cleanup order of Nkind declarations in Sinfo

2013-01-04 Thread Arnaud Charlet
This is an internal cleanup, no functional effect, no test Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-04 Robert Dewar * sinfo.ads: Clean up order of N_xxx subtypes Index: sinfo.ads === --- sinfo.ads (rev

Re: [PATCH] Fix PR864, apply program_transform_name to ada tools

2013-01-07 Thread Arnaud Charlet
> This makes us unconditionally apply program_transform_name when > installing > $(ADA_TOOLS). It's a patch distros have been applying for ages (now > I've updated it for 4.8 which meant re-writing it completely so I am > eligible to submit it). > > Bootstrapped on x86_64-unknown-linux-gnu with -

Re: RFA: Update copyright for libada

2013-01-13 Thread Arnaud Charlet
> Here's the result of running the copyright script on libada/. > Again, it's very short, but I've kept with the idiom of not > listing every file. > > Tested on x86_64-linux-gnu (with Ada enabled). OK to install? OK, thanks.

[Ada] Obsolescence considerations for pragma Interface/Interface_Name

2013-01-29 Thread Arnaud Charlet
Interface is now flagged as violating restriction No_Obsolescent_Features even in Ada 95 mode. Both Interface and Interface_Name cause warnings to be issued with -gnatwj (but we don't consider that Interface_Name violates the restriction, since Interface_Name is a GNAT defined pragma that is not i

[Ada] Avoid duplexing of fields in entity nodes (internal change)

2013-01-29 Thread Arnaud Charlet
This patch uses the newly available fields in an extended entity node to avoid some nasty cases of field duplexing, which we try to avoid. Internal change only, no functional effect, no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-29 Robert Dewar * atree.ads, atree.

[Ada] Allow Ada 2012 aspects on renaming declarations

2013-01-29 Thread Arnaud Charlet
This patch completes the implementation of Ada 2012 aspects on all renaming declarations. This is only relevant for implementation-defined aspects such as Warnings, as shown by the following example program which is compiled with -gnatwa -gnatld7 1. pragma Ada_2012; 2. procedure renameas

[Ada] gnatmake find old ALI files in wrong object directory

2013-01-29 Thread Arnaud Charlet
When gnatmake is invoked with project files and a source has been moved from one project A to another project B in the project tree, but the ALI and object files has not be removed from the object directory of A, gnatmake may always recompile the source moved to project B, even when it is up to dat

[Ada] Fixes to -gnatyn mode (casing of standard identifiers)

2013-01-29 Thread Arnaud Charlet
Identifiers for other than control characters and LC_? in ASCII are not all upper case, they are mixed case. This patch corrects that error in the handling of -gnatyn. It also removes a couple of references to ASCII.BACK_SLASH from the run-time, since they are now flagged, and removing the referenc

[Ada] gnat stub -P crashes when Ada is not a language of the project

2013-01-29 Thread Arnaud Charlet
This patch prevents the GNAT driver from crashing when it is called as "gnat stub -P ..." and Ada is not one of the languages of the project, for example if the project is an aggregate project. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-29 Vincent Celier * gnatcmd.adb:

[Ada] Ada 2012: Rule on function writable actuals (AI05-0144-2)

2013-01-29 Thread Arnaud Charlet
If the construct N has two or more direct constituents that are names or expressions whose evaluation may occur in an arbitrary order, at least one of which contains a function call with an in out or out parameter, then the construct is legal only if: for each name that is passed as a parameter of

[Ada] Expression functions and protected definitions

2013-01-29 Thread Arnaud Charlet
An expression_function_declaration is a different syntactic category from a subprogram_declaration. As a consequence, an expression function cannot appear in a protected definition, i.e. cannot declare a protected operation. Compiling essai.adb must yield: essai.adb:4:07: an expression functio

[Ada] Insertion of generated constructs in N_Expression_With_Actions nodes

2013-01-29 Thread Arnaud Charlet
This patch corrects the mechanism that inserts various generated constructs in the tree, in particular the interaction with expression_with_actions nodes. No test case applicable as this latent bug was found during code reading. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-29 Hristi

[Ada] Preliminary work to coordinate Pragma Warnings and middle-end warnings

2013-02-06 Thread Arnaud Charlet
This couple of adjustments paves the way for the full coordination of Pragma Warnings with the warnings issued by the diagnostic engine of the middle-end. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-02-06 Eric Botcazou * erroutc.adb (Validate_Specific_Warning): Do not issue

[Ada] Internal clean up for N_Pragma nodes

2013-02-06 Thread Arnaud Charlet
The specification for N_Pragma nodes requires that all pragma arguments by represented by N_Pragma_Associatin nodes, but in several cases naked expressions appeared. This patch corrects this irregularity, and also cleans up the format of Make_Pragma calls throughout these files. This was noticed du

[Ada] Missing finalization of temporary function results in case and if

2013-02-06 Thread Arnaud Charlet
This patch adds machinery to properly finalize temporary controlled function results that appear in N_Expression_With_Actions nodes as well as case and if expressions. In general, such temporaries must be finalized after the related context is elaborated/evaluated. -- Source -- --

<    10   11   12   13   14   15   16   17   18   19   >