[Ada] Explicitly pass exception occurrence to notifiers

2012-07-16 Thread Arnaud Charlet
This is an internal cleanup and preliminary to removal of useless ada occurrence copy. No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-16 Tristan Gingold * a-exexpr.adb (Propagate_Exception): Adjust call to Exception_Traces procedures. *

[Ada] Cleanup of selective accept expansion

2012-07-16 Thread Arnaud Charlet
This change reorganizes code generation for selective accept statements so that the expanded tree is well formed. This cleanup is desirable in preparation for further changes related to coverage analysis. No observable change in generated code's behaviour. Tested on x86_64-pc-linux-gnu, committed

[Ada] Coverage analysis of select statements

2012-07-16 Thread Arnaud Charlet
This change introduces generation of a null statement in alternatives appearing in various forms of select statement, when they do not have trailing statements. The purpose of the additional null statement is to allow a nop to be generated with an appropriate source location indication in debug inf

[Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Arnaud Charlet
The natural way to import a builtin that returns void * is to use System.Address in Ada, which is in fact an integral type. Addressed by this patch, which makes it possible to e.g. compile: with System; procedure Btins1 is function Frame_Address (Level : Integer) return System.Address; pra

Re: [Ada] Optimization of the Lock-free implementation of protected object

2012-07-16 Thread Arnaud Charlet
> http://gcc.gnu.org/ml/gcc-cvs/2012-07/msg00341.html > > This breaks ada bootstrap on powerpc-darwin9 with : > Undefined symbols: > "___sync_val_compare_and_swap_8", referenced from: > _system__atomic_primitives__lock_free_try_write_64 in > s-atopri.o > "___atomic_load_8", refere

[Ada] Add new debug procedure psloc

2012-07-17 Thread Arnaud Charlet
Add a new debug procedure psloc, to display a source location. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-17 Tristan Gingold * treepr.ads (psloc): Declare. * treepr.adb (psloc): New debug procedure to print a sloc. (Print_Sloc): New procedure, from ...

[Ada] Consistent tree decoration to import C++ classes

2012-07-17 Thread Arnaud Charlet
For consistency, entity Ada.Tags.Prim_Ptr must be decorated with attribute Is_Dispatch_Table_Entity to help the backend generating code for dispatching calls. This decoration was missing in CPP_Types thus causing problems in some architectures (for example, IA-64/Linux). Tested on x86_64-pc-linux-

[Ada] Fix potential access violation in Adjust routine

2012-07-17 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-17 Pascal Obry * s-regexp.adb (Adjust): Fix access violation in Adjust. Index: s-regexp.adb === --- s-regexp.adb(revision 189565) +++ s-regexp.adb(

[Ada] Contracts on imported subprograms

2012-07-17 Thread Arnaud Charlet
Currently pre/postconditions are enforced by means of expansions in the body of the corresponding subprogram. If the subprogram is imported there is no available body on which to insert the checking code, and thr user should be warned that the contracts will not be enforced. THe command: gcc -

[Ada] Minor tweak to expanded code for transient objects

2012-07-17 Thread Arnaud Charlet
This change makes it so that the finalization blocks generated for controlled transient objects, as well the final raise statement, are all wrapped into a block, so as to make it easier for the back-end to understand the construct. No functional changes. Tested on x86_64-pc-linux-gnu, committed o

[Ada] Fix to 64-bit atomic operation failures on ppc-linux

2012-07-17 Thread Arnaud Charlet
This patch fixes failures due to the use of 64-bit atomic operations on ppc-linux. Undo of the previous patch for 64-bit atomic operations only. Note: this does NOT address the failure on ppc-darwin, which will be addressed by another patch soon. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] gnatmake -s -gnatn1 always recompiles

2012-07-17 Thread Arnaud Charlet
This patch ensures that when -gnatn1 is used gnatmake -s will not always recompile. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-17 Vincent Celier * switch-m.adb (Normalize_Compiler_Switches): Recognize new switches -gnatn1 and -gnatn2. Index: switch-m.adb ==

[Ada] Fix nit in raise-gcc.c

2012-07-17 Thread Arnaud Charlet
In some cases, a cleanup action was missed. No reduced testcase found. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-17 Tristan Gingold * raise-gcc.c (get_call_site_action_for): Remove useless init expression for p. (get_action_description_for): Do not over

[Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
This patch implements a check in the runtime library that determines whether the current target supports the atomic primitives up to 64 bits. This should fix build failures on e.g. powerpc-darwin. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Vincent Pucci * system-aix

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> Hi Arnaud, You removed Vincent who is the author of this patch, included here. >> --- s-atopri.adb (revision 189768) >> +++ s-atopri.adb (working copy) >> @@ -31,6 +31,58 @@ >> >> package body System.Atomic_Primitives is >> >> + -- >> + -- Lock_Free_Read_8 --

[Ada] Aspect specifications in subprogram bodies

2012-07-23 Thread Arnaud Charlet
Aspect specification can appear in subprogram bodies. To handle them in the parser the aspects that follow a subprogram specification must be collected, and attached to the proper declaration or body only after the nature of the enclosing construct has been determined. The following must compile q

[Ada] Fix to SCOs for SELECT alternatives with guard

2012-07-23 Thread Arnaud Charlet
This change fixes incorrect source location indications in SCOs for decisions corresponding to guard expressions in SELECT statements, which can cause a crash in coverage analysis tools. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Thomas Quinot * par_sco.adb (Process_

[Ada] Missing finalization of transient function result

2012-07-23 Thread Arnaud Charlet
This patch corrects the machinery which detects whether a particular transient context may raise an exception. Examine the original expression of an object declaration node because a function call that returns on the secondary stack may have been rewritten into something else and no longer appear a

[Ada] Support for coverage analysis of ACCEPT alternatives in SELECT statement

2012-07-23 Thread Arnaud Charlet
This change ensures that the NULL statement generated for coverage analysis purposes in an otherwise empty ACCEPT alternative is not eliminated by GIGI or the code generator by setting its Comes_From_Source flag. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Thomas Quinot

[Ada] Improve GNAT dimensionality checking system

2012-07-23 Thread Arnaud Charlet
For GNAT dimensionality checking system, accept constant declaration whose type is a dimensioned type when an initialization expression with dimension is present. The test presented below highlights this new patch: -- Source -- with System.Dim.Mks_IO; use System.Dim.Mks

[Ada] User-defined indexing operations

2012-07-23 Thread Arnaud Charlet
A user-defined indexing operation can have more than one index, for example to describe user-defined matrix types. The following must compile quietly: gcc -c -gnat12 test_indexing.adb --- with Ada.Text_IO; use Ada.Text_IO; with Project; use Project; with Matrix_3x3s; use Matrix_3x3s; wi

[Ada] Clean up of heap objects in the context of accessibility failures

2012-07-23 Thread Arnaud Charlet
This patch reimplements the way accessibility checks are performed on heap- allocated class-wide objects. The checks now contain clean up code which finalizes (if applicable) and deallocates the object. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Hristian Kirtchev * e

[Ada] Element allocators in indefinite containers need accessibility checks

2012-07-23 Thread Arnaud Charlet
Various operations in the indefinite containers perform initialized allocators for elements, and accessibility checks are required on those allocators which can fail when the actual type for Element_Type is a class-wide type and the operation is passed an element value of a type extension declared

[Ada] Ambiguities with class-wide operations on synchronized types

2012-07-23 Thread Arnaud Charlet
This patch fixes the code that implements AI05-0090, a check for ambiguities in calls to primitive operations of tagged synchronized types. No small example available. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Ed Schonberg * sem_ch4.adb (Analyze_Selected_Component)

[Ada] Always analyze loop body during semantic analysis in Alfa mode

2012-07-23 Thread Arnaud Charlet
In Alfa mode for formal verification, the loop form with an iterator is not expanded, thus the analysis of the loop body should be done during semantic analysis. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Yannick Moy * sem_ch5.adb (Analyze_Loop_Statement): Make sure

[Ada] Crash on private enumeration type when compiling with -gnatVa

2012-07-23 Thread Arnaud Charlet
This patch corrects the retrieval of the base type of an enumeration subtype. In certain cases the base type may be a private type, therefore the compiler must inspect its full view. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-23 Hristian Kirtchev * checks.adb (Determine

[Ada] New restrictions for the lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
This patch updates the restrictions of the lock-free implementation. Furthermore, it also catches every error messages issued by the routine Allows_Lock_Free_Implementation. The test below illustrates some of the new restrictions: -- Source -- package Typ is protecte

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> > This patch implements a check in the runtime library that determines > > whether > > the current target supports the atomic primitives up to 64 bits. > > If I understand the name of the flag, it looks like an "all or nothing" for > atomic primitives? Right. > is that a consequence of the lan

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> >> With the following, bootstrap completed on powerpc-apple-darwin9, > >> and > >> make check-ada shows no new fails. > >> Should I apply it? > > > > Looks good to me, go ahead, although I'm a bit surprised that you got an > > error, > > can you clarify what error you got? > > IIRC, that the fl

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> >> Looks good to me, go ahead, although I'm a bit surprised that you got an > >> error, > >> can you clarify what error you got? > > > > IIRC, that the flag was undefined. > > If it's important I can revert the fix in my local tree and re-build. > > Iaim > No need to do that. Indeed, the flag

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> The swicth is defaulted to be False in Targparm. > However, as far as I understood in Targparm, the switch must be present in > all system.ads packages but I may be wrong. That sounds wrong and isn't how other flags work. Vincent, can you please double check exactly what's happening, and in par

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
>> FWIW, I checked the build transcript for the failed case: >> >> s-atopri.adb:40:10: "Support_Atomic_Primitives" is undefined (more >> references follow) >> make[8]: *** [s-atopri.o] Error 1 >> >> cheers >> Iain > > Just got the same error... investigating Ah, so the issue is not in the compi

Re: [Ada] Lock-free implementation of protected objects

2012-07-23 Thread Arnaud Charlet
> Having a default can't work, as s-atopri.adb needs access to the flag. > Only the front end itself can use a default, not the run time. Well, this means the current design is broken and s-atopri.adb needs to be modified. As we discussed, we cannot assume that System.Support_Atomic_Primitives ex

[Ada] New restriction for lock-free implementation

2012-07-30 Thread Arnaud Charlet
This patch implements a new lock-free restriction. Thus, implicit dereferences of access values prevent, as well as explicit dereference, the lock-free implementation of protected objects. The test below illustrates the new lock-free restriction: -- Source -- generic

[Ada] Fix handling of -A binder argument by gnatmake

2012-07-30 Thread Arnaud Charlet
This change fixes the circuitry that passes binder flags from gnatmake: for some switches, relative path arguments are changed to absolute paths. However, for gnatbind the -A switch must not undergo this transformation. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-30 Thomas Quinot

[Ada] Fix value conversions for socket timeouts on Windows

2012-07-30 Thread Arnaud Charlet
This change adds a special case to Get_Socket_Option and Set_Socket_Option to account for a deviation of Windows' behaviour with respect to the standard sockets API: on that target, SO_RCVTIMEO and SO_SNDTIMEO expect a DWORD containing a milliseconds count, not a struct timeval, and furthermore if

Re: [PATCH] Missing change from gcc/ada/system.ads

2012-08-02 Thread Arnaud Charlet
> Revision http://gcc.gnu.org/viewcvs?view=revision&revision=189772 > added constant Support_Atomic_Primitives to the target specific > system-*.ads files. The default system.ads was not updated. > > The included patch > - adds the missing constant > - removes constants not present in other system

Re: [PATCH] Missing change from gcc/ada/system.ads

2012-08-03 Thread Arnaud Charlet
> It is however used when building libada if target specific version is not > specified > in gcc/ada/gcc_interface/Makefile.in. Well, then you should submit changes for Makefile.in for your unsupported target. That being said, see below: > In that case building libada fails due to missing Support

[Ada] Missing Constraint_Error in illegal conversion to C type

2012-08-06 Thread Arnaud Charlet
This patch removes an old range check optimization which incorrectly assumes that the type of an arbitrary expression can always fit in the target type of a conversion. -- Source -- -- main.adb with Interfaces; use Interfaces; procedure Main is subtype Small_Positi

[Ada] Skip unneeded expansion for Alfa mode

2012-08-06 Thread Arnaud Charlet
In Alfa mode for formal verification, a special expansion done in the frontend turns out to be both harmful and unneeded, because the formal verification backend relies on the types of nodes (hence is not robust w.r.t. a change to base type here), and does not suffer from the out-of-order issue tar

[Ada] Skip special expansion in Alfa mode

2012-08-06 Thread Arnaud Charlet
In Alfa mode for formal verification, a special expansion of the iterator is not needed, as the formal verification backend directly deals with the source form of the iterator. Thus, skip this expansion. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-08-06 Yannick Moy * sem_ch

[Ada] Redundant finalization of controlled function result

2012-08-06 Thread Arnaud Charlet
This patch removes obsolete code related to array initialization. When an array is initialized by an aggregate, the compiler may generate a loop to initialize all elements. If the aggregate contains controlled function calls, the loop statements are wrapped in a block for finalization purposes. The

[Ada] Fix delayed analysis of aspect specification when scopes differ

2012-08-06 Thread Arnaud Charlet
This patch properly analyses aspects in cases when scopes differ such as protected types, tasks, etc. The test illustrates the analysis of aspects at freeze point specified for a protected object. -- Source -- package T is type Typ is new Integer with Size => 128;

[Ada] Guard against cascaded error when processing deferred config pragmas

2012-08-06 Thread Arnaud Charlet
Some configuration pragmas require the presence of a compilation unit context to be processed. Their analysis is deferred until after the main unit has been analyzed. However, if that analysis fails for any reason, then the context may not be correctly established, and the deferred config pragmas m

[Ada] Incorrect parameter mechanism due to convention C_Pass_By_Copy

2012-08-06 Thread Arnaud Charlet
This patch corrects the Ada-C parameter passing mechanism for record types. OUT and IN OUT parameters are now unconditionally passed by reference regardless of whether C_Pass_By_Copy is in effect. IN parameters subject to the convention are passed by copy, otherwise they are passed by reference. -

[Ada] Protected objects with interrupt handlers are legal in nested scopes

2012-08-06 Thread Arnaud Charlet
AI95-0303 removes the rule that protected objects with handlers must be declared at the library level. The AI is a binding interpretation, and thus applies to earlier versions of the language as well. The new rule is tested in ACATS test BXC3002. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Lock-free implementation of protected objects (PR ada/54125)

2012-08-06 Thread Arnaud Charlet
This patch removes dependency on Support_Atomic_Primitives in the run-time package System.Atomic_Primitives by introducing a new attribute Atomic_Always_Lock_Free. This changes allow us to remove all the Support_Atomic_Primitives defaulted values in the corresponding system packages and fixes build

[Ada] Implement extended overflow checks, step 1

2012-08-06 Thread Arnaud Charlet
This patch extends the type Suppress_Array in types.ads to include the switches to control extended overflow checking. The new type is called Suppress_Record, and all uses elsewhere of Suppress_Array are changed to be Suppress_Record. So far, the only settings for the new overflow checking modes ar

[Ada] In Alfa mode, issue an error instead of a warning on a missing component

2012-08-06 Thread Arnaud Charlet
In Alfa mode, there is no use in applying formal verification to a codebase with a blatant error such as an access to a component not present in the type, so make the default warning an error in this mode. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-08-06 Yannick Moy * sem_

[Ada] Portability improvement for constants related to serial ports

2012-08-06 Thread Arnaud Charlet
This change improves the process that generates s-oscons.ads so that the proper unisgned values for serial ports related constants are generated. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-08-06 Thomas Quinot * s-oscons-tmplt.c, xoscons.adb: Per the Single UNIX Specificati

[Ada] Serial port flow control support

2012-08-06 Thread Arnaud Charlet
This change adds two new optional parameters to GNAT.Serial_Comminications.Set to allow the user to specify a local port (no modem control lines), and to choose a flow control method (none, hardware, software). Note that the default behaviour is now consistently no flow control on all platforms. Pr

[Ada] Reject exponent of dimensioned operand that is unknown at compile-time

2012-08-06 Thread Arnaud Charlet
The test presented below illustrates the current patch. -- Source -- with System.Dim.Mks;use System.Dim.Mks; with System.Dim.Mks_IO; use System.Dim.Mks_IO; procedure Main is begin for N in -3 .. +3 loop Put (m**N , Aft => 2, Exp => 0); end loop; end Main

[Ada] Inheritance of representation aspects at freezing point

2012-08-06 Thread Arnaud Charlet
The test presented below deals with the aspect Volatile. Indeed it's illegal to instantiate non-volatile formal object with volatile actual. -- Source -- package Volatile is type Volatile is tagged record R : Integer; end record with Volatile; -- Volatile

[Ada] Wrong size for variant records with single variant with front-end layout

2012-04-26 Thread Arnaud Charlet
When front-end layout is enabled (such as for non-GCC targets like AAMP), the RM_Size value of variant records with a static-sized single variant is computed incorrectly as storage units rather than bits (which can cause incorrect code for reading and writing objects). This case is now tested for a

[Ada] Finalization of controlled object in instance

2012-04-26 Thread Arnaud Charlet
This patch corrects the mechanism which determines whether a construct appears at the library level. This in turn allows for proper detection of cases where a Finalize_Storage_Only object appears in a nested scope and requires finalization. -- Source -- -- main.adb wit

[Ada] Freezing of non null subtypes of formal parameters

2012-04-26 Thread Arnaud Charlet
If the subtype indication for a formal parameter carries a non null indicator, the compiler creates an internal subtype for it. This subtype must be frozen after its designated type, so its freezing must be delayed, but only if the designated type is itself not frozen yet. The following must compi

[Ada] New package Clean in project files

2012-04-26 Thread Arnaud Charlet
A new package Clean with attributes Object_Artifact_Extensions and Source_Artifact_Extensions is created in project files. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-04-26 Vincent Celier * prj-attr.adb: New package Clean with attributes Object_Artifact_Extensions a

[Ada] Clean up of index usage in string literal subtypes

2012-04-26 Thread Arnaud Charlet
This patch adds code to retrieve the index type of a string literal. Since string literals do not use attribute First_Index, the proper index type is obtained from their low bound. No changes in compiler behavior. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-04-26 Hristian Kirtchev

[Ada] Ignore pragmas when looking for unreachable code

2012-04-26 Thread Arnaud Charlet
This patch causes pragmas to be ignored when checking for unreachable code, which catches additional cases not caught before, as shown by the following example, compiled with -gnatwe.w -gnatld7 1. with Ada.Text_IO; use Ada.Text_IO; 2. procedure Main4 is 3. begin 4.loop

[Ada] Dependency between System.Finalization_Root and Ada.Streams

2012-04-26 Thread Arnaud Charlet
This patch modifies System.Finalization_Root to avoid a dependency on streams. Type Root_Controlled is now abstract tagged null record. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-04-26 Hristian Kirtchev * s-finroo.ads: Remove with clause for Ada.Streams. Type Root_

[Ada] Minor reformatting and cleanup in adaint.c

2012-04-26 Thread Arnaud Charlet
Function to_host_path_spec is removed (was unused). No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-04-26 Tristan Gingold * adaint.c (to_host_path_spec): Removed (unused). Minor reformatting. Index: adaint.c ===

[Ada] Fix common misuses of the word "then" where "than" should be used in English.

2012-04-26 Thread Arnaud Charlet
Tested on x86_64-pc-linux-gnu, committed on trunk 2012-04-26 Vasiliy Fofanov * a-stzunb-shared.adb, gnat_ugn.texi, a-strunb-shared.adb, a-strunb-shared.ads, uintp.adb, a-stwiun-shared.adb, a-stwiun-shared.ads, a-cbhama.ads, vms_data.ads, a-cobove.adb, a-convec.a

Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-04-28 Thread Arnaud Charlet
> Le 06/04/2012 17:27, Pascal Obry a écrit : > > > > Back on this! It turn out that this breaks the shared Ada runtime. > > Indeed, exported variables on Ada packages in a DLLs are only accessible > > when linking against DLL (thanks to runtime pseudo reloc). > > > > With the patch applied it is

Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
> > Pascal, I'd suggest you go ahead and revert this patch. > > This patch has already been reverted by Eric on Apr 10 on gcc-4.7 branch. I'm talking about the FSF trunk repository. Arno

Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
> > I'm talking about the FSF trunk repository. > > Ah ok, but I do not have commit access to this repository. Eric maybe? If you send me a patch with changelog, I'll take care of it. Arno

Re: [patch] Fix cygwin ada install [was Re: Yet another issue with gcc current trunk with ada on cygwin]

2012-05-02 Thread Arnaud Charlet
OK, revision 184558 now reverted. Arno -- Index: gcc/ada/ChangeLog === --- gcc/ada/ChangeLog (revision 187037) +++ gcc/ada/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2012-05-02 Pascal Obry + + Revert + 2012-02-24 Da

[Ada] Deferred constants are not always compile time known values in Alfa mode

2012-05-15 Thread Arnaud Charlet
Outside of the scope of their full view, deferred constants are not anymore considered as compile time known values in Alfa mode. This allows parameterized formal verification, in which a deferred constant value if not known from client units. Tested on x86_64-pc-linux-gnu, committed on trunk 201

[Ada] Avoid incorrect detection of duplicate sources that are excluded

2012-05-15 Thread Arnaud Charlet
If two projects in the hierarchy had a common source directory but through exclusion partitioned the sources in this source directory, the project manager was still finding incorrect source duplications. This patch corrects this. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Vince

[Ada] Better control of help message in GNAT.Command_Line

2012-05-15 Thread Arnaud Charlet
This is a cosmetic change only, and gives better control over the help message that is automatically generated from the definition of valid switches. Instead of using the generic name "ARG", users can now specify their own name, which sometimes helps clarify the intents of the parameter. Tested on

[Ada] Clean up System.Address_To_Access_Conversions

2012-05-15 Thread Arnaud Charlet
This patch does a bit of cleanup in System.Address_To_Access_Conversions. No change in behavior; no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Bob Duff * s-atacco.ads s-atacco.adb: Replace pragma Elaborate_Body with pragma No_Body. (Xyz): Remove

[Ada] Static matching of subtypes in Ada 2012

2012-05-15 Thread Arnaud Charlet
In Ada 2012, static matching of subtypes requires that the static predicates that apply to the subtypes come from the same declaration. Compiling predmatch.ads in Ada 2012 mode must yield: predmatch.ads:5:21: object subtype must statically match designated subtype predmatch.ads:12:22: objec

[Ada] Case statements over predicated subtypes

2012-05-15 Thread Arnaud Charlet
In Ada 2012, if a subtype has a static predicate the set of its possible values is known statically and those are the alternatives that must be covered in in case statement. If the subtype has dynamic predicates, the alternatives must cover all values of the base type. Compiling nonstaticcase.adb

[Ada] Simplify binder code

2012-05-15 Thread Arnaud Charlet
This patch simply moves code from the binder generated file to a-except, to slightly simplify the binder. Preliminary work. No testcase as there is no functionnal change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Tristan Gingold * bindgen.adb (Gen_Header): Remove c

[Ada] Give full msg for finalize/adjust only if -gnateE.

2012-05-15 Thread Arnaud Charlet
The circuitery to save the first exception message (reraised as PE) in finalize or adjust operations has a distributed code size impact. This circuitery is now only enabled when then switch -gnateE is specified. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Tristan Gingold

[Ada] Missing DSA remote access to subprogram rules enforcement

2012-05-15 Thread Arnaud Charlet
This change adds missing code to enforce language restrictions for remote access to subprogram types in the case of 'Unchecked_Access and 'Unrestricted_ Access. The following compilation must be rejected with the given error message: $ gcc -c server_main.adb server_main.adb:11:35: prefix must stat

[Ada] Save occurrence on the stack before calling last chance handler

2012-05-15 Thread Arnaud Charlet
The occurrence was already saved but in dynamically allocated memory. This patch saves it on the stack to avoid the allocation, which useful in case of Storage_Error. No functional change in normal conditions. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Tristan Gingold

[Ada] Get rid of compilation warnings in raise-gcc.c

2012-05-15 Thread Arnaud Charlet
No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Tristan Gingold * raise-gcc.c (db_region_for): Use %p + cast to avoid warnings. (get_region_description_for): Likewise. (db_action_for): Likewise. (get_call_site_action_for): Lik

[Ada] Interfacing aspects in Ada 2012

2012-05-15 Thread Arnaud Charlet
The aspects Convention, Export, and Import are intended to replace the use of the earlier pragmas by the same names. The additional aspects External_Name and Link_Nmae provide the remaining functionality. which previously was provided by additional pragma arguments. Tested on x86_64-pc-linux-gnu,

[Ada] Add postconditions to numeric functions

2012-05-15 Thread Arnaud Charlet
Ada RM requires numeric functions to return values in specific ranges, and specific values for some specified argument values. Many of these are now translated as Ada 2012 Post aspects on numeric functions. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-05-15 Yannick Moy * a-n

[Ada] Private with-clauses in the context of generic package declarations

2012-05-15 Thread Arnaud Charlet
In ihe context of a generic package declaration, a private with-clause on a child unit implies that the implicit with clauses on its parents are private as well. Previous to this patch, GNAT applied this rule applied only to non- eneric units. Compiling the following must be rejected with: gp

[Ada] Fix cross-unit inlining on internal inline subprograms

2012-05-15 Thread Arnaud Charlet
This restores cross-unit inlining for user-defined internal inline subprograms invoked from public inline subprograms. This also reworks the algorithm used to compute the list of inlined subprograms passed to gigi. The old algorithm attempts to compute a topological order on the list, and thus s

[Ada] Couple of small adjustments to cross-unit inlining

2012-05-15 Thread Arnaud Charlet
The first adjustment ensures that the compiler doesn't inline back into the main unit subprograms coming from subunits, since they are already compiled. The second adjustment ensures that the transitive closure algorithm keeps excluding the subprograms not handled by Add_Inlined_Body. Tested on x8

[Ada] Imaging of arbitrary precision integers

2012-05-15 Thread Arnaud Charlet
The compiler includes an arbitrary precision integer computation library, which is used to handle numeric literals in source code (which are allowed to be of arbitrary size). This change improves the code responsible for producing a string image of such integers by using a single Euclidian division

[Ada] Better handling of illegal iterators

2012-05-15 Thread Arnaud Charlet
This patch improves on the error message for a loop iterator where the loop variable is referenced in the name of the iterator. Compiling main.adb must yield: main.adb:26:17: object "X" cannot be used before end of its declaration --- pragma Ada_2012; pragma Warnings (Off); with Ada.Text_IO

[Ada] Restrict propagation of atomicity from objects to types

2012-05-15 Thread Arnaud Charlet
The front-end uses a trick to accept a pragma Atomic on objects whose type isn't directly suitable for the pragma: if the type is declared in the same unit as the object, the front-end propagates under the hood the atomicity from the object to the type. This can have unwanted effects, most notably

Re: FYI: 1500+ typos, with suggested fixes

2012-05-29 Thread Arnaud Charlet
> Also note: the line numbers listed below work for me with yesterday's > up-to-date trunk, but if you want to use these commands, you should rerun > the commands above so that the line numbers reflect your actual sources. > ) > > This is just a heads up. > I'm not volunteering to make these chang

[Ada] Fix error message printed for invalid access to atomic component

2012-06-12 Thread Arnaud Charlet
This changes the error message printed for an invalid access to an atomic component, which was: access to volatile object cannot yield access-to-non-volatile type into the more correct: access to atomic object cannot yield access-to-non-atomic type The problem was that Is_Atomic_Object returned

[Ada] Proper implementation of interfacing aspects.

2012-06-12 Thread Arnaud Charlet
This patch implements properly the aspects Convention, Import, Export, Link_ Name and External_Name, which replace the corresponding Ada 2005 pragmas. Compiling missing_convention.ads must yield: missing_convention.ads:3:07: missing Convention aspect for Export/Import --- function missing_conv

[Ada] Treat -fdump-scos as synonym of -gnateS

2012-06-12 Thread Arnaud Charlet
This change allows the use of -fdump-scos as a synonym of -gnateS to request the generation of SCOs in Ada ALI files. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-12 Thomas Quinot * back_end.adb (Scan_Back_End_Switches): Treat -fdump-scos as synonym of -gnateS.

[Ada] Accidental overlodading in an instance

2012-06-12 Thread Arnaud Charlet
This patch handles a rare case of accidental overloading in an instance, when the profile of a subprogram body that depends on a formal type becomes compatible with that of a homonym whose profile in the generic mentions the actual type. execution of inst.adb must yield: expected T... In P (T) ex

[Ada] Handling of (illegal) null record unchecked union

2012-06-12 Thread Arnaud Charlet
A "null record" type does not have a variant part, so it is not a legal candidate for pragma Unchecked_Union. This change fixes the circuitry that enforces this rule so that it correctly rejects such illegal code instead of crashing the compiler. The following compilation must be rejected with the

[Ada] Dereferences and inferable discriminants

2012-06-12 Thread Arnaud Charlet
An implicit dereference of an access to constrained unchecked union subtype has inferable discriminants. This change fixes the Has_Inferable_Discriminants function to take this case into account properly. The following program must compile quietly and display "OK" when executed: with Ada.Text_IO;

[Ada] Adding information of exported entities to ALI files

2012-06-12 Thread Arnaud Charlet
This patch extends the information generated by the compiler in ALI files adding references to entities exported to foreign languages. This information can be used by cross reference tools and text editors (for example, GPS). Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-12 Javier Mi

[Ada] Add support for project file Install package.

2012-06-12 Thread Arnaud Charlet
This package will be used with the gprinstall tool. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-12 Pascal Obry * prj-attr.adb: Add install package and corresponding attributes. * snames.ads-tmpl (Name_Active): New constant. (Name_Exec_Subdir): Likewise.

[Ada] Delete symbolic link silently.

2012-06-12 Thread Arnaud Charlet
The following test must run without raising an exception on systems supporting symbolic links: with Ada.Directories; use Ada.Directories; with Ada.Text_IO; use Ada.Text_IO; procedure Delln is F1 : constant String := "libname.so"; F2 : constant String := "libname.so.1"; File : File

[Ada] Ada 2012: AI05-0296, formal incomplete types.

2012-06-12 Thread Arnaud Charlet
This patch implements AI05-0296, concerning freeze rules in the presence of formal incomplete types: a formal abstract subprogram cannot have an incomplete controlling type, and the profile of the actual subprogram is not frozen if it includes a incomplete untagged type. Compiling abstr.ads in Ada

[Ada] Object declarations and finalization of transient variables

2012-06-12 Thread Arnaud Charlet
This patch adds code to recognize a scenario where an object is initialized by a sequence of nested function calls where one of them returns a controlled result. This in turn triggers the mechanism which exports such transient objects to the enclosing finalizer on the assumption that one of the cal

[Ada] Cleanup front end code (introduce N_Subprogram_Call)

2012-06-12 Thread Arnaud Charlet
This patch is a minor cleanup in the front end. It introduces a new subtype N_Subprogram_Call which includes N_Function_Call and N_Procedure_Call_Statement, and then uses this new subtype in many place in the front end where it simplifies the code. Since there is no change in behavior, no test is r

[Ada] Avoid memory exhaustion when using gnatmake -m

2012-06-12 Thread Arnaud Charlet
In large systems, gnatmake may crash when invoked with -m (minimal recompilation) when there are many sources that have been modified but have kept the same checksum. This patch fixes this. There is no simple test. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-12 Vincent Celier

[Ada] New variant of -gnatn to specify inlining level

2012-06-12 Thread Arnaud Charlet
With this change, the compiler now supports the -gnatn[d] switch, where 'd' is a digit and can only be '1' or '2' for the time being, to let the user specify the level of inlining across modules. If the old form `-gnatn' is used, the compiler will pick the inlining level based on the optimization l

<    12   13   14   15   16   17   18   19   20   21   >