[Ada] Allow constants in SPARK contracts

2015-05-21 Thread Arnaud Charlet
This patch permits constants to appear in the following SPARK annotations: Depends Global Initializes Part_Of Refined_Depends Refined_Global Refined_State -- Source -- -- legal_usage.ads package Legal_Usage with SPARK_Mode,

[Ada] Handling of object declarations with aggregates and specified alignment.

2015-05-12 Thread Arnaud Charlet
When an object declaration for an array object includes an aggregate expression and the aspect Alignment is specified for the object, the object must be initialized with an explicit assignment at the point the object is frozen. Such special processing was developed for address clauses, but it must

[Ada] Visibility of a generic grand-child unit instantiated in its parent.

2015-05-12 Thread Arnaud Charlet
This patch fixes a spurious error when a generic grand-child unit is instantiated in the body of its parent, i.e. a generic child unit, and the name of the grand-child is fully qualified with that of its ancestors. The following must compile quietly: gnatmake -q c --- with A; procedure C is

[Ada] Fix undetected overflow case in Ada.Real_Time./

2015-05-12 Thread Arnaud Charlet
Despite the explicit pragma Unsuppress statements, the case of dividing Time_Span_First by -1 did not raise an exception. Eventually this should be corrected at the compiler or runtime level, but for now, we add an explicit check to ensure that this case is caught. The following test program:

[Ada] Shadow entity of class-wide types

2015-05-12 Thread Arnaud Charlet
This patch performs a minor improvement to infrastructure of the frontend consisting in the unconditional construction of a shadow entity associated with the class-wide entity of tagged types (previously the shadow entity was only built by the frontend only if the real entity was not available).

[Ada] Implement new pragma Ignore_Pragma

2015-05-12 Thread Arnaud Charlet
This implements a new configuration pragma Ignore_Pragma (IDENTIFIER) which causes any subsequent occurrences of pragma IDENTIFIER (...) to be completely ignored. The following test program compiles as shown: 1. procedure IgnorePR is 2. begin 3.pragma Ignore_Pragma;

[Ada] Generic_Dispatching_Constructor and multiple interfaces.

2015-05-12 Thread Arnaud Charlet
This patch fixes a regression in the handling of the generic_dispatching_ constructor in the presence of several levels of interfaces. Previous to this patch, a dispatching call might call the wrong primitive of an object whose type overrides a primitive inherited from an interface that has

[Ada] Add constants to g-sercom for slow bit rates

2015-05-12 Thread Arnaud Charlet
This change introduces new literals B75, B110, B150, B300, and B600 for enumerated type GNAT.Serial_Communications.Data_Rate, denoting the corresponding bit rates. This allows communication with legacy devices that require them. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-05-12

[Ada] Incomplete types and null procedures.

2015-05-12 Thread Arnaud Charlet
An untagged incomeplete type is legal in the profile of a null procedure. This patch remotes a spurious error on such, because the legality check for the use of an incomplete type was also applied to the subprogram body generated during expansion of a null procedure declaration. The following

[Ada] Implement new pragma/aspect Volatile_Full_Access

2015-05-12 Thread Arnaud Charlet
A new pragma (and equivalent aspect) Volatile_Full_Access is implemented. This is similar to Volatile except that there is a guarantee that every read and write access to an object with this aspect will always use a single instruction which reads or writes all the bits of the object. Note that

[Ada] Legality checks on a formal derived type derived from previous formal.

2015-05-12 Thread Arnaud Charlet
This patch adds a missing legality check on the instantiation of a formal derived type whose parent type is a previous formal of the same generic unit, that is not a derived type. Compiling generic_testm.adb must yield: generic_testm.adb:7:26: expect type derived from Integer in instantiation

Re: GNAT User's Guide /onlinedocs broken? (was: Broken links on gcc.gnu.org/onlinedocs)

2015-04-11 Thread Arnaud Charlet
/ It does still work for GCC 4.9.1 and GCC 4.8.3: https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gnat_ugn_unw/ https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gnat_ugn_unw/ Arnaud, you updated maintainer-scripts update_web_docs_svn as follows last year, might this be related? 2014-08-01 Arnaud Charlet

Re: [PATCH][ada][PR65490] Fix bzero warning in child_setup_tty

2015-03-31 Thread Arnaud Charlet
- /* ensure that s is filled with 0 */ - bzero (s, sizeof (s)); + /* Ensure that s is filled with 0. */ Please keep the comment as is, we do not put dots on single partial sentences (otherwise you would have to change these everywhere, and you and I do not really want that). +

Re: [PATCH][ada][PR65490] Fix bzero warning in child_setup_tty

2015-03-31 Thread Arnaud Charlet
OK for stage 4/stage1? Thanks, - Tom Fix bzero warning in child_setup_tty 2015-03-30 Tom de Vries t...@codesourcery.com PR ada/65490 * terminals.c (child_setup_tty): Fix warning 'argument to sizeof in bzero call is the same expression as the destination'. ---

Re: [PATCH, Ada] Fix powerpc-darwin bootstrap with gcc-trunk.

2015-03-29 Thread Arnaud Charlet
(cd ada/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo sinfo.h ) raised PROGRAM_ERROR : s-atocou.adb:57 explicit raise Looking at this code, it indicates that it is a dummy implementation for platforms without an atomic increment support. hence, I concluded (possibly erroneously) that such

Re: [PATCH, Ada] Fix powerpc-darwin bootstrap with gcc-trunk.

2015-03-29 Thread Arnaud Charlet
Currently Ada bootstrap is broken for bootstrap compiler == gcc-trunk, and platform == powerpc-darwin9 (although it is possible to bootstrap with gcc-4.9). The reason is that generations of sinfo.h appears now to _require_ support for atomics (I assume that's intended). No, that's

Re: [PATCH, Ada] Fix powerpc-darwin bootstrap with gcc-trunk.

2015-03-29 Thread Arnaud Charlet
So, FAOD, you're OK with my applying the patch to trunk for gcc-5? Yes, that's fine.

[Ada] New attribute typ'Deref (address-expr)

2015-03-24 Thread Arnaud Charlet
This attribute is equivalent to (atyp!(address-expr)).all where atyp is a general-access-to-typ type. Right now, only the front end changes are done. The back end needs to adapt to this change too. The following is a test which should compile and run silently 1. with System; use System;

Re: [PATCH] Fix Ada bootstrap (PR bootstrap/65522)

2015-03-23 Thread Arnaud Charlet
In any case, for compatibility, this patch just changes the guard so that adadecode.c's ada_demangle is compiled only into libgnat*.{a,so} and not into gnat1, which can then successfully link against libiberty cplus-dem.o. The ipa-devirt.c change is obvious IMHO, the same header is included

[Ada] Clean up generation of FIRST/LAST temps for bounds

2015-03-13 Thread Arnaud Charlet
This is an internal change to the cleanup and simplify the generation of FIRST/LAST temporaries for subtype bounds. No test is needed since no functional effect on the behavior of the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-03-13 Robert Dewar de...@adacore.com

[Ada] Preliminary work for aspect Unimplemented

2015-03-13 Thread Arnaud Charlet
This is some preliminary checkins for aspect Unimplemented. No functionality yet, so no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-03-13 Robert Dewar de...@adacore.com * aspects.ads, aspects.adb: Add entries for aspect Unimplemented. * einfo.ads, einfo.adb

[Ada] Add extra entity fields

2015-03-13 Thread Arnaud Charlet
This change is an internal change to add extra fields to each entity for future use. No functional effect. No test required. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-03-13 Robert Dewar de...@adacore.com * einfo.adb, einfo.ads, atree.adb, atree.ads, atree.h: Add seventh

[Ada] Spurious runtime failure on Default_Initial_Condition

2015-03-04 Thread Arnaud Charlet
This patch ensures that the expression of pragma Default_Initial_Condition is verified against an object with default initialization. -- Source -- -- dic_pack.ads generic type Element_Typ is private; No_Element : Element_Typ; package DIC_Pack is type List

[Ada] Wrong runtime check on function returning interface type

2015-03-04 Thread Arnaud Charlet
For functions returning class-wide interface types the compiler may generate erroneous code implementing the Ada rule 6.5(8/3), thus causing an unexpected exception at runtime. After this patch the following test compiles and executes without errors. package Ifaces is type Iface is limited

[Ada] Bounded string slice fails when passed superflat bounds

2015-03-04 Thread Arnaud Charlet
If a bounded string slice operation has a lower bound less than the higher bound minus one, the resulting length can be negative leading to failures and exceptions. The following must compile and execute cleanly: 1. with Ada.Strings.Bounded; use Ada.Strings.Bounded; 2. with

[Ada] Syntax error detection on Ghost abstract states

2015-03-04 Thread Arnaud Charlet
This patch modifies the analysis of pragma Abstract_State to detect a syntax error related to a state with a simple option. -- Source -- -- malformed_state.ads package Malformed_State with SPARK_Mode, Abstract_State = (State1, State2 = Ghost) is end

[Ada] Fix problem with unnesting of subprograms

2015-03-04 Thread Arnaud Charlet
The subprogram unnesting circuit did not properly handle the case where we are adding an ARECnF formal, and there are already extra formals present. This is fixed by now using the normal Extra_Formal circuit for adding the ARECnF formal. This also required significant repair to Sprint, which was

Re: [Ada] convert GNAT doc to sphinx

2015-03-03 Thread Arnaud Charlet
As discussed last year, we've converted the GNAT main documentation (gnat_rm.texi and gnat_ugn.texi) to reST/sphinx, so the master doc can now be found under gcc/ada/doc. there is an empty directory left in SVN: gcc/ada/doc/share/_static ok to remove? No, this (empty currently)

[Ada] Initial checkin for unnesting of subprograms

2015-03-02 Thread Arnaud Charlet
This is an initial checkin for the feature of unnesting subprograms in the front end (for use by alternate, non GCC backends). The documentation is complete, but the implementation checked in is only part of the final implementation, so no test needed yet. Tested on x86_64-pc-linux-gnu, committed

[Ada] Compiler hang with full inlining and use clause in parent private part

2015-03-02 Thread Arnaud Charlet
When compiling a descendant instance unit use_clauses in parent units are chained to simplify removal at end of compilation. Use_clauses that appear in the private part of parent are chained when compiling the private part of the descendant. To prevent circularities in the list, use_clauses in the

[Ada] Type_Invariant'Class on interface types

2015-03-02 Thread Arnaud Charlet
This new language feature allows Type_Invariant'class on interface types. When a type implements one or several interfaces, its inherited type invariant is the conjunction of all ancestor Type_Invariant'Class. The following package now compiles without errors: package AI12_0041 is type VIntf

[Ada] Output of errors related to Pre'Class, Pre_Class, Post'Class, Post_Class

2015-03-02 Thread Arnaud Charlet
This patch takes advantage of the recently introduced mechanism that outputs special names _Pre and _Post to emit errors related to pre/postconditions. No change in behavior, no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-03-02 Hristian Kirtchev kirtc...@adacore.com *

[Ada] Argument of pragma Depends has wrong source location

2015-03-02 Thread Arnaud Charlet
This patch ensures that the normalization mechanism which services aspects or pragmas Abstract_State, Contract_State, Depends, Global, Initializes, Refined_Depends, Refined_Global and Refined_State properly sets the source location of the first item. No change in behavior. No reproducer possible

Re: [Ada] convert GNAT doc to sphinx

2015-02-26 Thread Arnaud Charlet
Thanks for your feedback, very useful! How are you testing this? When getting the jit docs to work I had to hack up the script somewhat to be able to test it on a development box (e.g. to cut back MANUALS to just libcpp to speed up testing). That's a good question. Truth is that so far I'm

Re: [Ada] convert GNAT doc to sphinx

2015-02-25 Thread Arnaud Charlet
I've added a -I gcc/gcc/ada/doc/gnat_ugn there, that's as far as my knowledge goes for this script so I hope this is enough. Well, since by default the find command deletes all files except those known to be documentation sources, you need at least to change it not to delete those

Re: [Ada] convert GNAT doc to sphinx

2015-02-25 Thread Arnaud Charlet
Two .png files were missing, now added: 2015-02-22 Arnaud Charlet char...@adacore.com * doc/gnat_ugn/project-manager-figure.png, doc/gnat_ugn/rtlibrary-structure.png: New. The maintainer-scripts/update_web_docs_svn script is still producing

Re: [Ada] convert GNAT doc to sphinx

2015-02-25 Thread Arnaud Charlet
So you need to update the find command therein not to remove anything that's part of the sources for this documentation, and possibly update -I options for building manuals as well. I've added a -I gcc/gcc/ada/doc/gnat_ugn there, that's as far as my knowledge goes for this script so I hope

Re: [Ada] convert GNAT doc to sphinx

2015-02-22 Thread Arnaud Charlet
2015-02-20 Arnaud Charlet char...@adacore.com * gnat_rm.texi, gnat_ugn.texi: Now automatically generated from sphinx in the doc directory. * doc: New directory containing sphinx versions of gnat_rm and gnat_ugn Hi, I'm observing

Re: [Ada] convert GNAT doc to sphinx

2015-02-22 Thread Arnaud Charlet
Your patch removes these arguments to dircategory: ... $ git show bf5dffd3a47fe12ace71fe48e87cfb1b9ada1344 | grep dircategory +@dircategory -@dircategory GNU Ada tools -@dircategory GNU Ada tools +@dircategory ... Well OK but these are automatically generated now, and this doesn't really

Re: [PATCH] Fix warnings from including fdl.texi into gnat-style.texi

2015-02-22 Thread Arnaud Charlet
While generating gnat-style.info, we see these warnings: ... src/gcc/doc/include/fdl.texi:33: warning: node `Index' is next for `GNU Free Documentation License' in menu but not in sectioning src/gcc/doc/include/fdl.texi:33: warning: node `Top' is up for `GNU Free Documentation License' in

Re: [Ada] convert GNAT doc to sphinx

2015-02-22 Thread Arnaud Charlet
I didn't see a question here: ... As for the @dircategory I do not know, I couldn't find a proper documentation for this node other than: http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Installing-Dir-Entries.html#index-dircategory which is incomplete. ... Could you indicate

[Ada] Better error recovery for statement used in place of declaration

2015-02-20 Thread Arnaud Charlet
If a statement appears where a declaration is expected, then an appropriate error message is given, but the tree is malformed leading to a later crash if -gnatQ is used. The following should compile with -gnatQ without giving a compilation abandoned message: 1. procedure AssignInD is

[Ada] Non-preemptive dispatching

2015-02-20 Thread Arnaud Charlet
Make Non_Preemptive_FIFO_Within_Priorities a standard dispatching policy name as defined in RM D.2.4(2/2). Create the language-defined library package Ada.Dispatching.Non_Preemptive, as defined in RM D.2.4(2.2/3). This package is marked as unimplemented because no target environment supports it.

[Ada] Better error message for illegal Invariant'class aspect

2015-02-20 Thread Arnaud Charlet
Within the compiler class-wide aspects use a leading-underscore internal identifier. If the placement of the aspect is illegal, the error message must mention the original form of the aspect. Compiling class_a.ads must yield: class_a.ads:5:10: aspect Type_Invariant_Class only allowed

[Ada] Wrong type conversion on access to limited-with interface

2015-02-20 Thread Arnaud Charlet
If the type of the operand of a type conversion is defined as an access to a class-wide interface type, and the target interface type is defined in a package visible at the point of declaration of the access type through a limited-with clause, then the compiler may silently skip generating code

[Ada] convert GNAT doc to sphinx

2015-02-20 Thread Arnaud Charlet
with the GCC Makefiles. Not including the diff which is very large and not very interesting. Tested on x86_64-pc-linux-gnu, committed on trunk. 2015-02-20 Arnaud Charlet char...@adacore.com * gnat_rm.texi, gnat_ugn.texi: Now automatically generated from sphinx

[Ada] --RTS= specified several times for same runtime directory

2015-02-20 Thread Arnaud Charlet
When the compiler is invoked with several --RTS= switches, with different values designated the same runtime directory, the compiler reports an error that RTS cannot be specified several times. This patch fixes this problem. The test for this is to invoke the compiler with two switches --RTS=, one

[Ada] Allow pragma Inline_Always to overrule -fno-inline

2015-02-20 Thread Arnaud Charlet
Prior to this change, -fno-inline was stopping all the inlining unconditionally, even when requested with a pragma Inline_Always. This was inconsistent with the behavior of the always_inline gcc attribute, and this change fixes this. It also removes an internal shortcircuit which was preventing

[Ada] Fix internal error on inlining of renamed subprogram instantiation

2015-02-20 Thread Arnaud Charlet
This fixes an assertion failure in gigi triggered by an order-of-elaboration issue for the type of a parameter of a subprogram which is both the renaming of another subprogram and marked Inline. In this case the compiler was using expansion (aka front-end inlining) but this doesn't always play

[Ada] use proper name for Type_Invariant'Class in messages

2015-02-20 Thread Arnaud Charlet
In some error messages, the aspect name Type_Invariant'Class appeared as Type_Invariant_Class, this is now fixed. The following is compiled with -gnatl -gnatj60: 1. package Class_Aspect is 2.type A_T is tagged private; 3.procedure P (Arg : Integer) with 4.

[Ada] Indirect calls are always external

2015-02-20 Thread Arnaud Charlet
an indirect call through an access-to-protected-subprogram value is always considered an external call. This patch makes that happen (previously, the compiler was using internal calls in some cases). The following test should run to completion, silently. (Before the bug fix, it would hang,

Re: Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process

2015-02-10 Thread Arnaud Charlet
When building Ada for RTEMS, you need to pass in the CFLAGS_FOR_TARGET to see OS specific .h files. This was already done for the RTS but needed to be added to the process which extracts value settings from the .h files. This patch is against 4.9. OK to apply to 4.8, 4.9, and head assuming

[Ada] Add optional argument for tool name to pragma Warnings

2015-02-05 Thread Arnaud Charlet
Users of GNATprove can now specify pragma Warnings for GNAT and GNATprove separately, to selectively disable warnings from the compiler or the formal verification tool. This also allows detecting useless pragma Warnings with switch -gnatw.w Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] missing error on interface overriding

2015-02-05 Thread Arnaud Charlet
If an inherited subprogram is implemented by a protected function, then the first parameter of the inherited subprogram shall be of mode in, but not an access-to-variable parameter (RM 9.4(11/9) After this patch the error is reported in the following example: procedure by30015_01p is package

[Ada] Fix missing index check with optimization on

2015-02-05 Thread Arnaud Charlet
In some unusual cases, the index check on a subscript of an unconstrained array was omitted. The following test program 1. package Out_Constraint_Violation is 2.type Arr is array (Natural range ) of Integer; 3.procedure Violate 4. (Input : Arr; Modifier : Arr;

[Ada] Handle WHEN used in place of WITH nicely

2015-02-05 Thread Arnaud Charlet
This patch improves the error recovery when WHEN is used in place of WITH for aspect specifications: 1. package WhenWith is 2.X : integer when Size = 4; | when should be with 3.Y : integer when Rubbish; |

[Ada] Poor error message on pragma SPARK_Mode

2015-02-05 Thread Arnaud Charlet
This patch modifies the mode conformance checks of pragma SPARK_Mode to account for the case where the pragma appears without an argument. -- Source -- -- pack.ads package Pack is procedure Error; end Pack; -- pack.adb package body Pack is procedure Error

[Ada] Record fatal errors in tree even in -gnatq/Q mode

2015-02-05 Thread Arnaud Charlet
This internal modification changes the representation of the Fatal_Error field in the unit record to record the presence of fatal errors even if -gnatq/Q is set. No functional effect for the compiler itself so no test now. This should allow an improvement in ASIS processing which will be

[Ada] Fix bootstrapping on darwin9/10 (PR64349)

2015-02-05 Thread Arnaud Charlet
Move Darwin case before default one. Hopefully should be the last iteration on this PR, sorry about the confusion! Committed on trunk. 2015-02-05 Tristan Gingold ging...@adacore.com PR ada/64349 * env.c: Fix thinko: handle Darwin case before default one. Index: env.c

[Ada] Fix bootstrapping on darwin9/10 (PR ada/64349)

2015-01-30 Thread Arnaud Charlet
Avoid possible warning on darwin during compiler build. Should hopefully close PR 64349, committed on trunk 2015-01-30 Tristan Gingold ging...@adacore.com PR ada/64349 * env.c: Move vxworks and darwin includes out of #ifdef IN_RTS. Index: env.c

[Ada] Obscure ambiguity involving user-defined operators returning Boolean

2015-01-30 Thread Arnaud Charlet
This patch fixes a rather obscure bug in case there is a user-defined + operator returning Boolean, passed to two contexts where the expected type is Boolean, and the expected type is the result of the PREdefined operator. This is ambiguous, and therefore illegal. gnatmake -q -f cutdown1-main.adb

[Ada] Suppress Import-In-Pure-Unit warning if Pure_Function given

2015-01-30 Thread Arnaud Charlet
The warning for use of Import in a Pure unit is refined so that it is omitted if an explicit Pure_Function aspect is given, as shown by the following test, compiled with -gnatl 1. package PureImportF is 2. pragma Pure (PureImportF); 3.function F (A : integer) return integer;

[Ada] Rejection of legal use of subp'Access within a generic body

2015-01-30 Thread Arnaud Charlet
When the Access attribute is applied within a generic body to a prefix that denotes a subprogram declared in an enclosing generic unit, the compiler rejects this as a violation of the rule in the last sentence of RM 3.10.2(32/3). This is happening because the compiler is requiring both the access

[Ada] Improve message for condition always False (simple variable case)

2015-01-30 Thread Arnaud Charlet
The warning message for an always True condition special cased the simple variable case. This special casing is now extended for the False case as well: 1. package CCF_Warn is 2.procedure Mess; 3. end; 1. package body CCF_Warn is 2. type T is array (1..10) of

[Ada] Improve error message of interface primitive overriding

2015-01-30 Thread Arnaud Charlet
This patch improves the text of the error reported for RM 9.4(11.9). This new output is visible using this small reproducer: procedure by30018 is package pack is type Iface is synchronized interface; procedure Prim1_1 (M : in Iface) is abstract; protected type T_PO is new

[Ada] Wrong Finalize_Address leads to Segmentation_Fault

2015-01-30 Thread Arnaud Charlet
This patch reimplements a key aspect of heap-allocated controlled objects. Primitive Finalize_Address is now associated with the finalization master of an access-to-controlled type when the designated type is frozen and not at the point of object allocation. -- Source --

Re: [PATCH] Fix ada bootstrap under cygwin-64

2015-01-27 Thread Arnaud Charlet
this patch fixes the ada bootstrap under cygwin-64. Boot-strapped under x86_64-pc-cygwin. OK for trunk? OK

Re: [Ada] Fix bootstrapping on darwin9/10 (PR ada/64349).

2015-01-20 Thread Arnaud Charlet
Any news on when this might hit trunk? - it is a bootstrap issue (although on older targets). Right, and you have local patches/a work around. I have been on paternity leave, so with no time to sync our changes (and with other priorities :-)). My next sync won't be before next week. Let us

[Ada] Repair No_Strict_Aliasing configuration pragma

2015-01-07 Thread Arnaud Charlet
This reimplements the No_Strict_Aliasing configuration pragma, which didn't work neither for private types nor for access-to-unconstrained-array types. The following program must compile quietly with -O2: pragma No_Strict_Aliasing; with Q; use Q; package P is type Ptr is private; type

[Ada] Disable wrapper for SPARK in the case of External Axiomatization

2015-01-07 Thread Arnaud Charlet
Usually a wrapper is generated in the case of a classwide type as actual of a generic package. In Gnatprove_Mode, and when the generic has external axiomatizations, This wrapper is not only useless but confuses gnatprove, so it is disabled here. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] gnatmake and gnatclean with projects are obsolete

2015-01-07 Thread Arnaud Charlet
A new warning is now issued when gnatmake or gnatclean sre invoke with -P indicationg that it is now obsolete and that the support will be removed in the next release. Support for project files is an advanced feature that is no longer properly supported by gnatmake, instead the proper support has

[Ada] Avoid incorrect warning on limited with that item is unreferenced

2015-01-07 Thread Arnaud Charlet
Under certain complex circumstances, a LIMITED WITH clause can result in an incorrect warning that the with'ed item is not referenced, when in fact it is referenced. No simple test is available. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-07 Robert Dewar de...@adacore.com

[Ada] Fix bootstrapping on darwin9/10 (PR ada/64349).

2015-01-07 Thread Arnaud Charlet
Use _NSGetEnviron to get environment. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-07 Tristan Gingold ging...@adacore.com PR ada/64349 * env.c (__gnat_environ): Adjust for darwin9/darwin10. Index: env.c

[Ada] disable some files for SPARK cross references

2015-01-07 Thread Arnaud Charlet
Some D files do not correspond to Ada units, and as such present no interest for SPARK cross references. Skip these files, as printing their name may require printing the full name with spaces, which is not handled in the code doing I/O of SPARK cross references. Tested on x86_64-pc-linux-gnu,

[Ada] Implement RT_Resolution properly

2015-01-07 Thread Arnaud Charlet
Previously RT_Resolution was returning a hard coded dummy value. With this change we now use the relevant system call to compute the clock resolution. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-07 Doug Rupp r...@adacore.com * s-osinte-mingw.ads (LARGE_INTEGR): New

[Ada] Warn on suspicious Subprogram'Access

2015-01-07 Thread Arnaud Charlet
This patch adds a warning on certain occurrences of Subprogram'Access that could cause an access-before-elaboration error. The following example should give a warning when compiled with the -gnatw.f switch: % gcc -c -gnatw.f -gnatwe elab_acc.adb elab_acc.ads:4:31: warning: Access attribute of F

[Ada] Fix inconsistent diagnostics for support of Atomic aspect

2015-01-07 Thread Arnaud Charlet
This changes makes it so that the compiler issues the same diagnostics on invalid bit-packed array types with atomic component whatever the origin of the Atomic aspect. For the following package: package P is type Arr1 is array (1 .. 16) of Boolean; pragma Atomic_Components (Arr1); for

[Ada] Implement new Restriction No_Use_Of_Entity

2015-01-07 Thread Arnaud Charlet
A new restriction No_Use_Of_Entity is implemented. The form of this is pragma Restriction[_Warning]s (No_Use_Of_Entity = NAME), where NAME is a fully qualified entity name. The effect is to forbid references to this entity in the main unit, its spec, and any subunits. The following is compiled

[Ada] Invariant checks on view conversion

2015-01-07 Thread Arnaud Charlet
This patch inplements RM 7.3.2 (12/3): an invariant check must be applied to the result of a view conversion if the type of the expression has invariants. THe following must execute quietly: gnatmake -q -gnata t_package_test t_package_test --- with Ada.Assertions; use Ada.Assertions; with

[Ada] improve front-end floating point attributes computation

2015-01-06 Thread Arnaud Charlet
The internal tree nodes for the standard Ada floating point types are derived from back-end information provided via a type registration hook. The registration is performed by the set_targ elaboration code, constructing the FPT_Mode_Table which cstand.Create_Standard scans later on to construct

[Ada] Function in RCI cannot have anonymous access result

2015-01-06 Thread Arnaud Charlet
Enforce rule from E.2.3(14/3): the return type of an RCI function must support external streaming; per 13.13.2(52/3) an anonymous access type does not support external streaming. The following code is illegal and must be rejected: $ gcc -c rci_func_return_anon_access.adb

[Ada] Document recognition of : in place of #

2015-01-06 Thread Arnaud Charlet
This adds an RM reference to J.2 for the run-time routines that allow colon as a replacement for hash in based notation. Comment changes only, no external effect, so no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-06 Robert Dewar de...@adacore.com * s-valllu.adb,

[Ada] SCOs: handle the Short_Circuit_And_Or pragma

2015-01-06 Thread Arnaud Charlet
This change ensures that and and or operators affected by the Short_Circuit_And_Or pragma are considered as part of SCO decisions, just like the and then and or else operators. The following compilation must produce a decision SCO as shown: $ gcc -c -fdump-scos cc4.adb $ grep ^CX cc4.ali CX

[Ada] Preliminary work for new restriction No_Use_Of_Entity

2015-01-06 Thread Arnaud Charlet
This checkin is preliminary work for a new restriction No_Use_Of_Entity. No test needed, since no external effect yet! Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-06 Robert Dewar de...@adacore.com * namet.ads: Document use of Boolean2 for No_Use_Of_Entity. *

[Ada] Rework the initialization/finalization of the runtime.

2015-01-06 Thread Arnaud Charlet
A new routine named __gnat_runtime_initialize is introduced to initialize the runtime and another one to finalize it. Code from __gnat_finalize have been moved to __gnat_runtime_initialize when it applies. This makes a C main calling adainit() and adafinal() as documented behave as if the main was

[Ada] Handle Str'Last = Positive'Last in Text_IO.Get routines

2015-01-06 Thread Arnaud Charlet
The Get routines in Text_IO that take a string argument were behaving incorrectly when From'Last = Positive'Last. This is a very bizarre case which probably will never occur in practice, but it leads to undefined behavior (one possibility is a confusing raise of Data_Error). It is not worth

[Ada] Remove unreachable code in Freeze_Array_Type

2015-01-06 Thread Arnaud Charlet
In the Alias_Atomic_Check block, Complain_CS has these lines: if Known_Static_Esize (Ctyp) then Error_Msg_N (incorrect component size for T components, Clause);

[Ada] New directories in project path for gnatls --RTS=

2015-01-06 Thread Arnaud Charlet
Two new directories are added in the project path, when gnatls is invoked with --RTS=, just before the two directories for the target. When the runtime is a single name, the directories are: prefix/target/runtime/lib/gnat prefix/target/runtime/share/gpr Otherwise, the runtime directory is

[Ada] Bump copyright year

2015-01-06 Thread Arnaud Charlet
Committed on trunk. * gnatvsn.ads: Bump copyright year. Index: gnatvsn.ads === --- gnatvsn.ads (revision 219191) +++ gnatvsn.ads (working copy) @@ -6,7 +6,7 @@ --

[Ada] Missing error on access type conversion

2015-01-06 Thread Arnaud Charlet
When the target of a type conversion is an access to an interface type and the operand is not an access type but a tagged object which covers the target interface the frontend does not report an error. After this patch the compiler reports the missing error: package Speaker is type Root is

[Ada] Add warning for Suppress (Elaboration_Check) in SPARK

2015-01-06 Thread Arnaud Charlet
This adds an additional warning message for Suppress (Elaboration_Check) in SPARK mode: The following is compiled with -gnatj55 1. pragma SPARK_Mode (On); 2. package SupEcheck is 3.pragma Suppress (Elaboration_Check); | warning: Suppress of

[Ada] Make sure we check divide by zero for fixed-point divide case

2015-01-06 Thread Arnaud Charlet
On some targets, the compiler does not generate a required divide by zero check for the case of fixed-point operands. This was noticed in the context of the second division function in Ada.Real_Time, but is a quite general problem. The following program: 1. function DivCTest return Duration

[Ada] Fix bad error message for No_Elaboration_Code_All

2015-01-06 Thread Arnaud Charlet
This fixes a problem in the diagnostic for violation of the restriction No_Elaboration_Code_All. In some cases, the location of the restriction incorrectly points to the pragma in system.ads. The following test should compile as shown whether or not there is a NECA pragma in System. 1.

[Ada] Add additional Boolean fields to Name Table info

2015-01-06 Thread Arnaud Charlet
This is an internal change to create two new Boolean Name_Table info fields. No external effect, no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-01-06 Robert Dewar de...@adacore.com * exp_util.adb: Change name Name_Table_Boolean to Name_Table_Boolean1.

[Ada] Changes to SPARK RM 7.1.3(11)

2015-01-06 Thread Arnaud Charlet
This patch implements a side effect of SPARK RM rule 7.1.3(11) which implies that an effectively volatile formal parameter of mode out cannot be read. -- Source -- -- async_writers_out.ads package Async_Writers_Out with SPARK_Mode is type Volat_Array is array (1 ..

[Ada] Use of incomplete types in invariant and predicate expressions.

2015-01-06 Thread Arnaud Charlet
An incomplete type may appear in the profile of a subprogram used in a predicate for the type. Analysis of the constructed predicate function will include a call to the subprogram, and an actual of the full type will be resolved against an actual of the incomplete view. This patch handles this

Re: [Patch, libada] Fix PR64349 - make darwin use the correct interface to access _environ.

2014-12-22 Thread Arnaud Charlet
Iain, The change isn't quite right for iOS (aka arm-darwin), but the general idea is the right one. Tristan (cc:ed) has prepared a patch for this issue which works on both MAC OS and darwin), which I'll merge soon. This will address this PR. Arno

Re: [Patch, libada] Fix PR64349 - make darwin use the correct interface to access _environ.

2014-12-22 Thread Arnaud Charlet
hmm.. I wasn't aware of a [ 4.2.1] arm-mach-o backend .. if that's a general issue, then I'll consider it for future patches. Yes please. Tristan (cc:ed) has prepared a patch for this issue which works on both MAC OS and darwin), which I'll merge soon. This will address this PR. Thanks,

[Ada] Missing interface conversion in access type

2014-11-20 Thread Arnaud Charlet
The compiler silently skips the generation of code to perform the conversion of an access type whose designated type is a class-wide interface type, thus causing unexpected problems at runtime in dispatching calls to the target object. After this patch the following test compiles and executes

[Ada] Lift limitation of inter-unit inlining with generic packages

2014-11-20 Thread Arnaud Charlet
This change lifts the arbitrary limitation on the number of iterations that can be executed between loading of the inlined bodies and instantiation of the generic bodies of external units when inter-unit inlining is activated. It was previously limited to 1 but this may be not sufficient in some

<    3   4   5   6   7   8   9   10   11   12   >