[Ada] Fix obscure race condition in term alts

2011-08-04 Thread Arnaud Charlet
This patch is fixes an obscure race condition in the implementation of terminate alternatives. No small test case is available. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Bob Duff d...@adacore.com * s-tasren.adb (Task_Do_Or_Queue): Previous code was reading

[Ada] Remove detection of entities in the ALFA subset for formal verification

2011-08-04 Thread Arnaud Charlet
The detection of entities in ALFA is best left in a back-end of the compiler, so all the machinery for flagging entities as in ALFA, and the body of subprograms as in ALFA, have been removed. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com *

[Ada] Detect useless assignments to parts of objects

2011-08-04 Thread Arnaud Charlet
GNAT did not issue a warning when assigning to a part of an object, and not referencing the object later on. Now it does so in some cases, similarly to the existing warnings on assignment to elementary objects. On the code below, GNAT now issues warnings: $ gcc -c -gnatwa assign.adb

Re: [Ada] Detect useless assignments to parts of objects

2011-08-04 Thread Arnaud Charlet
Hi Arnaud, this is a great feature. How does it handle unchecked unions? Will it warn if you write to a field but only read the value via a different field? It's a simple minded check, nothing fancy. It will warn when there are no reference to the the object at all after the assignment, and

Re: PR ada/49944, take 2 [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with s-taprop.adb:856:10: pthread_attr_setaffinity_np is undefined (more references follow)

2011-08-04 Thread Arnaud Charlet
Pursuant to Arno's comments on PR ada/49444, here is another patch that allows GCC to compile with Ada support on Debian GNU/kFreeBSD. 2011-08-04 Ludovic Brenta ludo...@ludovic-brenta.org * gcc/ada/gcc-interface/Makefile.in (kfreebsd%): - use s-taprop-posix.ad[bs] instead of

[Ada] Save/restore value of pragma Normalize_Scalars

2011-08-04 Thread Arnaud Charlet
This patch adds the missing support to the frontend to save and restore consistently the settings of pragma Normalize_Scalars. Required to have consistent setting of its value when the compilation of a unit causes implicit analysis of runtime units. Before applying this patch the compilation of

[Ada] Fix discrepancy between initialization and finalization of libraries

2011-08-04 Thread Arnaud Charlet
This adjusts the finalization code emitted in the binder-generated file so as to make it symmetrical to the initialization code with regard to the handling of the elaboration counter. Both now increment or decrement the counter only once per library unit, even though the elaboration or

[Ada] Warning on premature task activation

2011-08-04 Thread Arnaud Charlet
An allocator for a local task in a package declaration will raise Program_Error because the elaboration check on the body will fail. THis patch adds a warning for this case. Compiling the following must yield: tasking.ads:6:18: warning: cannot activate task before body seen

[Ada] Remote types instance in private part of RCI spec

2011-08-04 Thread Arnaud Charlet
This change fixes a defect whereby instantiating a Remote_Types unit specifying user-defined stream attributes for one of its types in the private part of an RCI unit would cause undefined symbols in calling stubs. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Thomas Quinot

[Ada] Add support for binder/linker in gnatmake in CodePeer mode

2011-08-04 Thread Arnaud Charlet
In this patch, we enable calls to the binder and linker in gnatmake in CodePeer mode, to help support e.g. detection of global uninitialized variables or e.g. environment task race conditions. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Arnaud Charlet char...@adacore.com

[Ada] Attributes on predicated subtypes

2011-08-04 Thread Arnaud Charlet
To prevent anomalies with enumeration types with holes and scalar types with complex predicates, the attributes First, Last, and Range cannot be applied to subtypes with predicates. This rule applies only to scalar types. The following must compile quietly in Ada2012 mode: package Pred is

[Ada] Omit statement SCO for disabled pragma

2011-08-04 Thread Arnaud Charlet
This change ensures that no statement SCO is emitted for a disabled pragma. For the following compilation, the CS line shall contain only one entry (for the assignment statement), and no entry for the (disabled) pragma Assert. $ gcc -c -gnateS plop.adb $ grep ^C plop.ali C 1 plop.adb CS 8:4-8:15

[Ada] Change error message in Ada 2012 mode for misplaced if and case

2011-08-04 Thread Arnaud Charlet
GNAT was issuing a wrong message about a missing operand in some cases of ill-parenthesized code in Ada 2012 mode. Now it issues a correct message about the missing parentheses. On the following code we get: $ gcc -c -gnat2012 -gnaty3 pred.ads pred.ads:5:30: conditional expression must be

[Ada] Correct order of evaluation of pre- and postcondition

2011-08-04 Thread Arnaud Charlet
GNAT was evaluating the right part of an AND-THEN pre- or postcondition before the left part, which could cause a wrong exception to be raised in case of a failing pre- or postcondition. On the code attached, compiling and executing now raises a precondition failure instead of a division by zero:

[Ada] Avoid the use of floating point in the front end

2011-08-04 Thread Arnaud Charlet
There was one use of floating point in the front end, in a function to estimate the equivalent decimal exponent for a universal real. While this use was probably OK, because a different estimate shouldn't affect compilation results, in general we do not want anything in the compiler that may

[Ada] Name resolution of class-wide operations with prefix notation

2011-08-04 Thread Arnaud Charlet
When resolving a prefixed call with class-wide actuals, we iterate over the class-wide operations of all ancestors of the controlling type. If the context is a function call any overloading is resolved by context. if the context is a procedure call there must be only one candidate interpretation,

[Ada] Extending library projects with no sources does not build

2011-08-04 Thread Arnaud Charlet
If a library project extending another one has no sources of its own, and there is an exception name with capital letters in the project being extended, then on platform with case-insensitive file names (such a Windows, Darwin or VMS), the invocation of gnatmake to build the library will fail.

[Ada] Legality rules for formal packages with box initialization

2011-08-04 Thread Arnaud Charlet
AI05-0025 specifies that a formal package is illegal if it includes a named box initialization for an overloaded formal subprogram. This is an extension of an existing rule for instantiations. Compiling proc1.adb in Ada2005 mode must yield the following: proc1.adb:10:05: instantiation

[Ada] Enrich ALFA cross references with the type of entity for parameters

2011-08-04 Thread Arnaud Charlet
In formal verification mode, in order to properly detect which parameters may be read/written by a subprogram, a new information is added to ALFA cross references. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com * alfa.ads (ALFA_Xref_Record):

[Ada] Correct wrong generation of ALFA cross-references

2011-08-04 Thread Arnaud Charlet
There was a problem with generation of ALFA cross-references for formal verification, which causes a reference to appear in two scopes. Now corrected. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com * lib-xref-alfa.adb (Add_ALFA_Xrefs):

[Ada] Special expansion in ALFA for pragma check/precondition/postcondition

2011-08-04 Thread Arnaud Charlet
In ALFA mode, we modify expansion so that pragma check are kept in the code, while pre- and postconditions are kept attached to entities rather than being inserted in the code. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com * exp_prag.adb

[Ada] AI05-0020 : universal operators of fixed point and access types

2011-08-04 Thread Arnaud Charlet
This AI specifies that a user-defined equality on an anonymous access type whose designated type is private does not lead to an ambiguity with the universal access equality operator in the body or child units of the defining package. The same is true for a multiplication operator on a private type

[Ada] Save/restore value of pragma Normalize_Scalars

2011-08-04 Thread Arnaud Charlet
This patch reverses the previous patch which saved/restore the values of pragma Normalize_Scalars because the value of Normalize_Scalars must not be saved/restored because once set to true its value never changes. That is, if a compilation unit has pragma Normalize_Scalars then it forces that

[Ada] Use unique names in ALFA cross reference in ALI files

2011-08-04 Thread Arnaud Charlet
The formal verification backend relies on unique names for the variables named in ALFA sections of ALI files. Thus, generate these unique names with a new function. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com * frontend.adb (Frontend):

[Ada] Set Entity for a created Identifier Node

2011-08-04 Thread Arnaud Charlet
The function Identifer_For, called from the code that generates the type declarations for string types in the standard package, now also sets the entity of the generated identifier. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Johannes Kanig ka...@adacore.com *

[Ada] Correct placement and checking of Test_Case pragma

2011-08-04 Thread Arnaud Charlet
Follow-up of changes for Test_Case pragma. Pragma is not allowed inside subprogram body, only after separate declaration. No two test cases with same name allowed on same entity. Correct error in checking procedure. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy

[Ada] Rewrite dynamic stack usage

2011-08-04 Thread Arnaud Charlet
The dynamic stack usage engine has been rewritten to slightly simplify it. It now provides accurate results on machine where the stack base is known. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Tristan Gingold ging...@adacore.com * s-tassta.adb (Task_Wrapper): Rewrite

[Ada] Improve support class-wide interface conversions in .NET

2011-08-04 Thread Arnaud Charlet
This patch improves the support for interface conversions in the .NET/JVM compiler extending the current support for attribute 'tag and adding the missing runtime checks required in interface conversions when the tag of the source is unknown at compile time. After this patch the following test

[Ada] Allow static string expression as name of Test_Case pragma/aspect

2011-08-04 Thread Arnaud Charlet
Follow-up of implementation of Test_Case pragma/aspect. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com * sem_prag.adb (Check_Arg_Is_String_Literal): remove useless procedure (Analyze_Pragma): allow static string expression for name of

[Ada] Special cross references in ALFA mode for constants and formals

2011-08-04 Thread Arnaud Charlet
ALFA mode used for formal verification requires different cross references, in which read of constants is absent, and formal is not referenced when used as selector of parameter association. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy m...@adacore.com *

[Ada] Default-initialize Nodes component

2011-08-04 Thread Arnaud Charlet
When manipulating bounded hash-table based container objects, that do not otherwise have any explicit initialization expression, the compiler would emit a warning about the object not being initialized, because the Nodes component of the hash table type had not been given an initialization

[Ada] Detect generics as violation of the SPARK restriction

2011-08-04 Thread Arnaud Charlet
When the SPARK restriction was set, GNAT was not issuing violations on generic. Now corrected. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Marc Sango sa...@adacore.com * sem_ch12.adb (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration,

[Ada] Remove C output of gnatbind

2011-08-04 Thread Arnaud Charlet
It is not possible anymore to generate the C version of the binder file. Switches -A and -C of gnatbind are now removed. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Tristan Gingold ging...@adacore.com * bindgen.adb (Gen_Adainit_C): Remove. (Gen_Adafinal_C):

[Ada] Implementation of AI05-0161 restriction No_Default_Stream_Attributes

2011-08-04 Thread Arnaud Charlet
This new restriction is intended to prevent the use of the predefined stream attributes for elementary types. A consequence of this restriction is that the default implementation of stream attributes for composite types cannot be created if any of its elementary components lacks user-defined Read

[Ada]Fix GNAT compilation error when SPARK restriction mode is set

2011-08-04 Thread Arnaud Charlet
GNAT compilation error when SPARK restriction mode was set with attribut reference violation is now correct. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Marc Sango sa...@adacore.com * sem_attr.adb (Analyze_Attribute): Replace the message invisible attribute

[Ada] Get gnatls project path from Prj.Env

2011-08-04 Thread Arnaud Charlet
This change removes circuitry in gnatls that tried to approximate what is done in Prj.Env.Initialize_Default_Project_Path to set the project search path, and instead uses that routine directly. This fixes an inconsistency between gnatls' output and the actual behaviour of other project aware

Re: Fix Tru64 UNIX Ada bootstrap

2011-08-05 Thread Arnaud Charlet
unfortunately, it turned out that this fix only works when compiling ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined. I need the following patch instead, which is also simpler for using CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in tsystem.h,

Re: PR ada/49944, take 2 [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with s-taprop.adb:856:10: pthread_attr_setaffinity_np is undefined (more references follow)

2011-08-05 Thread Arnaud Charlet
Here is my amended patch. I have fixed the stylistic issues in both s-osinte-kfreebsd-gnu.ads and in the original place, s-osinte-freebsd.ads. I hope the changelog entry is more correct, too. Better but not quite the standard style yet. I believe there's a doc in gnu.org explaining the

[Ada] Add support for file attributes on VxWorks 6

2011-08-05 Thread Arnaud Charlet
The routines to modify the file attributes (rwx) are now implemented on VxWorks 6 (kernel and RTP) using the underlying chmod VxWorks routine. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Jose Ruiz r...@adacore.com * adaint.c (__gnat_set_writable, __gnat_set_readable,

[Ada] update gnatmake usage

2011-08-05 Thread Arnaud Charlet
Switches --create-map-file and --create-map-file-mapfile are added to the gnatmake usage. Lines for these switches should be in the output of gnatmake --help. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Vincent Celier cel...@adacore.com * makeusg.adb: Add lines for

[Ada] Set special options for ALFA mode (formal verification)

2011-08-05 Thread Arnaud Charlet
In ALFA mode, compiler is working in a special way in which it should believe it generates actual object code, while it is not; warnings should not be issued; checks should not be inserted in the code; various pragmas should be ignored. Changing the startup of frontend to do that. Tested on

[Ada] Inherited subprograms may be both abstract and need overriding

2011-08-05 Thread Arnaud Charlet
AI05-0028 indicates that an inherited operation can be abstract, even if it is overridden in a currently non-visible private part, and also require overriding when the derived type is non-abstract. GNAT has always iplemented this properly. This patch improves on the error message when this error

[Ada] Expansion of Ada2012 predicate checks for type conversions

2011-08-05 Thread Arnaud Charlet
This patch fixes an infinite recursion in the application of predicate checks to type conversions. The following must compile quietly: gcc -c -gnat12 ./why-conversions.ads --- with Why.Ids; use Why.Ids; package Why.Conversions is function + (Id : W_Unused_At_Start_OId) return

[Ada] Visibility error in formal package with no associations

2011-08-05 Thread Arnaud Charlet
This patch fixes a visbility error involving the use the name of a generic package GP as a selector for a formal package that is an instantiation of GP. Compiling p-child.adb below must yield: p-child.ads:9:43: P1 is not a visible entity of Tested package body P.Child is package body P1

[Ada] Missing visibility check in formal packages

2011-08-05 Thread Arnaud Charlet
The compiler failed to reject a formal package whose name is the same as that of the generic unit, or its ultimate prefix. Compiling p-child2.ads must yield: p-child2.ads:7:43: Tested is hidden within declaration of formal package package P.Child2 is generic with package Tested is

Re: PR ada/49944, take 2 [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with s-taprop.adb:856:10: pthread_attr_setaffinity_np is undefined (more references follow)

2011-08-05 Thread Arnaud Charlet
--- This is the GNU/kFreeBSD (GNU/LinuxThreads) version of this package +-- This is the GNU/kFreeBSD PTHREADS version of this package Not sure why PTHREADS is upper cased here, any specific reason? Because that's how it was written in s-osint-freebsd.ads, that's all. Yes well,

[Ada] Implementation of AI05-0212 : implicit dereference types

2011-08-05 Thread Arnaud Charlet
Ada2012 introduces the notion of a reference type, to generalize the use of cursors in containers. A reference type is a type with an access discriminant, with the semantics that a reference to an object of the type is in fact a reference to the object denoted by the access discriminant. The

[Ada] SCO generation for pragma Debug

2011-08-05 Thread Arnaud Charlet
This change improves the SCO generation circuitry for pragma Debug. Specific support is added for dyadic pragma Debug (where the first argument is now treated as a P decision). SCO generation is suppressed altogether for any pragma Debug, or decision nested therein, if the pragma is not enabled.

[Ada] Equality testing against null in an instance

2011-08-05 Thread Arnaud Charlet
This patch fixes a view conflict in an instance, when an equality check against null involves an operand whose type is private and whose full view is a specific access type. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Ed Schonberg schonb...@adacore.com * sem_type.adb

[Ada] Do not generate SCO for use clause or rep clause

2011-08-05 Thread Arnaud Charlet
This change removes SCO generation for USE clauses and representation clauses, which should not be subjected to coverage analysis. The following compilation must produce a single statement SCO corresponding to the declaration of type T: $ gcc -c -gnateS no_sco.ads $ grep ^CS no_sco.ali CS

[Ada] Correct ALFA xrefs for separates and pre/post

2011-08-05 Thread Arnaud Charlet
The ALFA cross references generated for formal verification were missing for separates and incorrect inside pre/post. Now corrected. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Yannick Moy m...@adacore.com * lib-xref-alfa.adb (Collect_ALFA): generate the proper

[Ada] Implement -gnatyC for one space after -- in comments

2011-08-05 Thread Arnaud Charlet
For J505-006 This patch implements a new style switch option -gnatyC, which is just like -gnatyc but requiring one space after -- instead of two. Consider this test program: 1. package onespace is 2.-- don't flag this comment 3.-- don't flag this comment if -gnatyC

[Ada] Implement Disable policy for Check/Debug_Policy

2011-08-05 Thread Arnaud Charlet
This patch adds a new policy DISABLE for Check_Policy, Debug_Policy and Assertion_Policy. Selecting DISABLE completely disables the corresponding pragma, including skipping semantic analysis of the arguments. This allows the use of a package of debug stuff that can be with'ed and referenced by

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 changes.

[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

[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

[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 qui...@adacore.com * back_end.adb (Scan_Back_End_Switches): Treat -fdump-scos as

[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)

[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

[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 o...@adacore.com * prj-attr.adb: Add install package and corresponding attributes. * snames.ads-tmpl (Name_Active): New constant.

[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 :

[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] 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

[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

[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] Preliminary work to support SEH on Windows 64

2012-06-12 Thread Arnaud Charlet
No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-12 Tristan Gingold ging...@adacore.com * a-exexpr-gcc.adb (Unwind_Exception): Add 4 more private fields. Index: a-exexpr-gcc.adb === ---

[Ada] Interplay between exception handlers and finalization

2012-06-12 Thread Arnaud Charlet
This patch corrects the machinery which detects controlled objects inside a block created for the purposes of avoiding interference of exception handlers and At_End handlers. -- Source -- -- types.ads with Ada.Finalization; use Ada.Finalization; package Types is

[Ada] Funalization of controlled function results in conditional expression

2012-06-14 Thread Arnaud Charlet
This patch adds logic to postpone the finalization of temporary controlled function results in the context of conditional expressions because the results are finalized too early. -- Source -- -- types.ads with Ada.Finalization; use Ada.Finalization; package Types is

[Ada] Delay of aspect specification evaluation

2012-06-14 Thread Arnaud Charlet
This patch restores the original error messages for duplicated pragma and attribute definition clause and cleans up the ??? comments. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-14 Vincent Pucci pu...@adacore.com * einfo.adb einfo.ads (Get_Rep_Item): Removed.

[Ada] Fix crash in gnatname due to uninitialized variable

2012-06-14 Thread Arnaud Charlet
No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-14 Tristan Gingold ging...@adacore.com * gnatname.adb (Gnatname): Make sure that dynamic table argument_data is initialized. Index: gnatname.adb

[Ada] Attribute and pragma for lock-free implementation

2012-06-14 Thread Arnaud Charlet
This patch implements a Lock_Free pragma for Ada2005 usage and a Lock_Free attribute for user query. The test provided below illustrates the usage of both Lock_Free pragma and attribute. - -- Source -- - with Text_IO; use Text_IO; procedure Main is protected type

[Ada] Mode conformance for Ada 2012 aliased formal parameters

2012-06-14 Thread Arnaud Charlet
In Ada 2012 formal parameters can be declared explicitly aliased. Mode conformance now requires that both or neither formal be aliased. Compiling alias.adb must yield: alias.adb:7:13: not fully conformant with declaration at line 6 alias.adb:7:13: aliased parameter mismatch alias.ads:7:24: not

[Ada] Freezing nodes placement fixed with quantified expression inside an expression function.

2012-06-14 Thread Arnaud Charlet
This patch implements the correct freezing actions in the context of a quantified expression inside an expression function. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-14 Vincent Pucci pu...@adacore.com * freeze.adb (In_Exp_Body): Expression function case added.

[Ada] Checking for eliminated subprograms

2012-06-14 Thread Arnaud Charlet
A reference to a subprogram that appears in a pragma Eliminate is not an error if it appears within a default expression: the enclosing subprogram may itself be eliminated. Previous to this patch, the check for default expressions was performed when resolving a call, but not for attribute

[Ada] Add support for --program-prefix

2012-06-14 Thread Arnaud Charlet
Take into account the prefix specified with --program-prefix when installing and uninstalling the Ada tools. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-14 Jose Ruiz r...@adacore.com * gcc-interface/Make-lang.in (ada.install-common, ada.uninstall): Use the prefix

Re: [Ada] Add support for --program-prefix

2012-06-14 Thread Arnaud Charlet
Take into account the prefix specified with --program-prefix when installing and uninstalling the Ada tools. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-14 Jose Ruiz r...@adacore.com * gcc-interface/Make-lang.in (ada.install-common, ada.uninstall):

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

2012-06-18 Thread Arnaud Charlet
Here is a patch that adds a basic GCC Ada/GNAT configuration for x86 GNU/Hurd. This has originally been created by Svante Signell for use with Debian's GCC 4.6 package, and now I have ported it to trunk, and also applied some further changes. 2012-06-16 Svante Signell

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

2012-06-18 Thread Arnaud Charlet
Another comment: --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -80,7 +80,7 @@ pragma Style_Checks (M32766); /* Feature macro definitions */ -#if defined (__linux__) !defined (_XOPEN_SOURCE) +#if (defined (__linux__) || defined (__GNU__))

Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

2012-06-18 Thread Arnaud Charlet
Hi, I tried with s-taprop-posix.adb earlier (among many tries), but GNU/Hurd does not seem to be fully POSIX pthread compliant yet, unfortunately. At least to my findings. Well, would be good to understnad in more details what's missing. Some trivial missing wrappers are better put in

[Ada] Attribute 'Old should only be used in postconditions

2012-06-26 Thread Arnaud Charlet
Forbid the use of attribute 'Old outside of postconditions, as required in Ada 2012. Similarly as for 'Result, it may also be used in Ensures clauses of test cases and contract cases attached to the subprogram. There is no need anymore to detect specially references to local variables, which would

[Ada] Fields _CPU, _Priority and _Dispatching_Domain

2012-06-26 Thread Arnaud Charlet
This patch creates the fields _CPU, _Priority and _Dispatching_Domain in tasks' corresponding records when a rep item (pragm/attribute definition clause/aspect specification) for this aspect is present. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-06-26 Vincent Pucci

Re: [Ada] Attribute 'Old should only be used in postconditions

2012-06-28 Thread Arnaud Charlet
* sem_attr.adb (Analyze_Attribute): Detect if 'Old is used outside a postcondition, and issue an error in such a case. This has introduced the following failures in the gnat.dg testsuite: FAIL: gnat.dg/deep_old.adb (test for excess errors) FAIL: gnat.dg/old_errors.adb (test for

Re: [Ada] Attribute 'Old should only be used in postconditions

2012-06-28 Thread Arnaud Charlet
Probably suppress both, since they no longer make sense (they are testing an early implementation of 'Old, before 'Old was standardized in Ada 2012). I'll take care of it. Thanks! Sure, done for the record (revision 189042).

[Ada] Cleanup in raise-gcc.c

2012-07-09 Thread Arnaud Charlet
As this unit is always compiled for the runtime, remove the #ifndef IN_RTS parts. Also update comments and clean up code. No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-09 Tristan Gingold ging...@adacore.com * raise-gcc.c (db_indent): Simplify style,

[Ada] Delete Exp_Dbug.No_Dollar_In_Label

2012-07-09 Thread Arnaud Charlet
This variable is no longer used, so is removed. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-09 Joel Brobecker brobec...@adacore.com brobecker * exp_dbug.ads (No_Dollar_In_Label): Delete. Index: exp_dbug.ads

[Ada] Visibility of aspects between freeze point and end of declarations

2012-07-09 Thread Arnaud Charlet
Expressions of stream aspects and also aspects Variable_Indexing, Constant_Indexing, Default_Iterator and Iterator_Element are names that can be overloaded. This patch checks at the end of the declarations there is an interpretation of these names that matches the entity obtained at the freeze

[Ada] Analysis of delayed aspects for components in record types

2012-07-09 Thread Arnaud Charlet
The following test illustrates the exemple of an aspect Atomic that applies to a component of a record type. -- Source -- procedure Cutdown is type Rec is record Comp : aliased Integer; Acomp : aliased Integer with Atomic = Atom; end record;

[Ada] New generic routine to iterate through interface sources

2012-07-09 Thread Arnaud Charlet
This new routine interfaces through all sources needed to interface to a library. All the specs are handled and also the bodies when needed (if there is a pragma inline of the spec is generic for example). Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-09 Pascal Obry

[Ada] Preelaboration dependences for Remote_Types and RCI units

2012-07-09 Thread Arnaud Charlet
The declarations of Remote_Types and Remote_Call_Interface packages are allowed to depend on preelaborated packages, as specified in AI05-206, as long as the dependence is made using a private with_clause. Before this fix, the compiler was disallowing such a dependence for RCI packages, and for

[Ada] Rewrite CleanupUnwind_Handler to strictly follow ia64 ABI

2012-07-09 Thread Arnaud Charlet
Required when the unwinder is not the libgcc one (eg: on HP-UX). No functionnal change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-09 Tristan Gingold ging...@adacore.com * a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from raise-gcc.c *

[Ada] Ada.Streams.Stream_IO is preelaborated

2012-07-09 Thread Arnaud Charlet
AI05-0283 requires Ada.Streams.Stream_IO to be declared with a pragma Preelaborate, so that it can be used by other preelaborated units as well as by Remote_Types and Remote_Call_Interface units. The pragma has been added to that package along with several other GNAT library units on which it

[Ada] Proper handling of meaningless size clauses

2012-07-09 Thread Arnaud Charlet
This patch fixes an internal overflow when computing the alignment of a record component whose size is improperly specified as larger than the largest integer value. Compiling the following must yield: prob.adb:6:38: warning: 4294967168 bits of Unsigned_Integer_4 unused prob.adb:13:45: size for

[Ada] Remove code to emulate RM D.2.3(5/2) semantics on Windows

2012-07-09 Thread Arnaud Charlet
The run time contained code which tried to rearrange the ready queue in order to achieve Annex D semantics. This code was not very efficient, and it did not work with multiprocessors. We consider that we should live with standard Windows semantics. Tested on x86_64-pc-linux-gnu, committed on

[Ada] Lock_Free implementation for protected object

2012-07-09 Thread Arnaud Charlet
This patch reorganizes the Lock_Free restrictions. The compiler issues a warning whenever a Priority aspect/pragma is given while the lock-free implementation has been forced by an aspect/pragma. -- Source -- package T is protected type P1 with Lock_Free is

[Ada] Fix run-time restrictions dependency

2012-07-09 Thread Arnaud Charlet
This is the first step in dealing with the undesirable linkage between restrictions at compile/bind time (Rident), and restrictions accessible at run-time (System.Rident). This update stops the compiler from withing system.rident. No test, since no functional change. The general problem here is

[Ada] Prevent mispelling error messages

2012-07-09 Thread Arnaud Charlet
Prevent mispelling error messages with internal attribute names CPU, Dispatching_Domain and Interrupt_Priority. For example: -- Source -- pragma Ada_2012; procedure P is X : Integer; for X'CPU use 3; -- unrecognized attribute (internal to GNAT) for X'CPUX

[Ada] Action callback gets the project with sources

2012-07-09 Thread Arnaud Charlet
For aggregate projects and aggregate libraries we may have multiple references of the same project. Only one is properly initialized and can be iterated to get the corresponding sources. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-09 Pascal Obry o...@adacore.com *

[Ada] Report unhandled exceptions as unhandled

2012-07-12 Thread Arnaud Charlet
On some targets, there is a catch-all handler to catch unhandled exceptions. This patch adjust the personality routine to report them as unhandled. Behavior not changed. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-12 Tristan Gingold ging...@adacore.com * raise-gcc.c: Do

[Ada] Move GNAT.Byte_Swapping to System

2012-07-12 Thread Arnaud Charlet
This change moves the GNAT runtime package GNAT.Byte_Swapping under System (with a renaming under GNAT for compatibility) so that the unit can be used from expanded code at a later point. No visible behaviour change (simple code reorganization), no test. Tested on x86_64-pc-linux-gnu, committed

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