[Ada] Mark generated subtypes and loop iteration entity as in ALFA

2011-08-04 Thread Arnaud Charlet
When permitted by the bounds/base type of the subtype, mark it as being in ALFA, and similarly for the entity used to iterate over a loop. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy * sem_ch3.adb (Array_Type_Declaration): move test for type in ALFA

[Ada] Use current process id to create temp filenames (windows)

2011-08-04 Thread Arnaud Charlet
This ensures unicity of temp filenames across processes under Windows. Tested on i686-pc-mingw32, committed on trunk 2011-08-04 Pascal Obry * adaint.c (__gnat_tmp_name): Use current process id to create temp filenames, this ensures unicity of filenames across processes. Index

[Ada] Fix minor violation of B.1 (39) implementation advice

2011-08-04 Thread Arnaud Charlet
The RM B.1 (39) implementation advice says that the adainit/adafinal routines generated to manage Ada libraries from foreign languages should be idempotent. This adds an elaboration flag to the file generated by the binder and an early return to the routines to ensure that this is the case. Tested

[Ada] Deallocation of a single allocated object (PR ada/47880)

2011-08-04 Thread Arnaud Charlet
This change fixes a seg fault when a local storage pool has a single allocated object, and Unchecked_Deallocation is used to deallocate that object. The following test case must compile and execute quietly: $ gnatmake -q pooltest $ ./pooltest with System.Pool_Local; with Ada.Unchecked_Deallocati

[Ada] Add special case for "ALFA" in error message similar to "RM"

2011-08-04 Thread Arnaud Charlet
Occurrences of "ALFA" in error messages are now left capitalized, which avoids the need to clutter source code with occurrences of "'A'L'F'A". Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy * errout.ads Change comments: remove 'R'M as an example where quotes

[Ada] Duplicated SCO for decision in pragma Debug

2011-08-04 Thread Arnaud Charlet
This change removes an annoying irregularity in N_Pragma nodes, which had the last argument copied in two distinct syntactic descendents (Pragma_Argument_Associations and Debug_Statement) for a pragma Debug. This caused duplicated SCO information to be emitted for decisions occurring in the actual

[Ada] Improve support of size and alignment clauses

2011-08-04 Thread Arnaud Charlet
This changes the way size and alignment clauses interact with each other. Size clauses used to set the 'Size of a type in stone, although an alignment clause could force the back-end to set different values for 'Object_Size and 'Value_Size of the type, leading to an inconsistency when an object of

[Ada] Do not skip analysis of aspect X when X'Class aspect present (and reverse)

2011-08-04 Thread Arnaud Charlet
Compiling the following code now raises an error: package P is procedure Proc (X : out Boolean) with Post'Class => X, Post => not X, Post => X; end P; $ gcc -c -gnat2012 p.ads p.ads:5:11: aspect "Post" for "Proc" previously given at line 4 Tested on x86_64-pc-linux-gn

[Ada] Issue warning for missing -gnat2012 switch on aspect X'Class

2011-08-04 Thread Arnaud Charlet
When encountering aspect syntax in a mode where aspects are not allowed (language version < Ada 2012), the compiler was issuing a useful warning in most cases, but not on aspects X'Class. This is now fixed. Compiling the following code raises the error: $ gcc -c p.ads p.ads:3:06: aspect specifica

[Ada] Improve error message on misplaced 'Result in Ada 2012 mode

2011-08-04 Thread Arnaud Charlet
In Ada 2012 mode, 'Result is allowed both in Postcondition pragma and in aspect Post. The error message issued by GNAT was not mentioning aspect Post. This is now fixed. Compiling the following code in mode Ada 2012 raises the error: $ gcc -c -gnat2012 p.adb p.ads:3:18: "Result" attribute can onl

[Ada] Intrinsic operators with real operands

2011-08-04 Thread Arnaud Charlet
If a function call resolves to an operator that is declared intrinsic, the function call is replaced by an operator mode with the same operands. If the result type is private the operands have to be converted to the underlying predefined type (usually a numeric type). However, if an operand is a re

[Ada] Box-initialized components of aggregates in allocators

2011-08-04 Thread Arnaud Charlet
Box-initialized components are replaced with calls to the corresponding initialization procedures during resolution of the aggregate. This requires that the type of the aggregate and that of all its components be frozen before resolution is completed. In addition, such an aggregate may be the desi

[Ada] Detect misplaced 'Result when compiling spec file

2011-08-04 Thread Arnaud Charlet
A misplaced 'Result located in the precondition of a function was detected only when compiling the body file, not when compiling the spec file. This is now fixed. Compiling the following code raises an error: $ gcc -c -gnat2012 -gnatc p.adb p.ads:3:18: "Result" attribute can only appear in postco

[Ada] Improved runtime exception message for duplicated external tag

2011-08-04 Thread Arnaud Charlet
This change improves the exception message associated with PROGRAM_ERROR for duplicated external tag by including the value of the offending external tag. The following compilation must raise Program_Error with the indicated exception message: $ gnatmake -z dup_ext_tag.ads $ ./dup_ext_tag raise

[Ada] Use canonical case file name to check ALI file (-gnatc)

2011-08-04 Thread Arnaud Charlet
On Windows, if a source with a file name that includes capital letter is compiled with -gnatc, gnatmake will always recompile the file if invoked again with -gnatc. This patch fixes this. The test for this is to invoke several times gnatmake on Windows to compile, with -gnatc, sources from a proje

[Ada] SCO for nested decision in pragma

2011-08-04 Thread Arnaud Charlet
The decision SCO for the boolean expression in a pragma Assert is emitted only if assertion checking is enabled. This change ensures that this also applies to any nested decision within that expression. The following compilation must produce two decision SCOs (a CP and a CX) when compiled with -gn

[Ada] Clean-up: remove flag Pragma_Enabled

2011-08-04 Thread Arnaud Charlet
This change removes a historical flag that is not used anymore. No behaviour change, no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Thomas Quinot * sinfo.adb, sinfo.ads, sem_prag.adb, sem_ch12.adb (Pragma_Enabled): This flag of N_Pragma nodes is not used

[Ada] Improved error message on one-element positional aggregates

2011-08-04 Thread Arnaud Charlet
An illegal one-element positional aggregate is usually detected as a type error. If the expected type is a one-component record, it is possible to indicate what the proper syntax should be. A similar suggestion can be given if the context specifies a nameable array type or the target of an assignme

[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 * s-tasren.adb (Task_Do_Or_Queue): Previous code was reading Acceptor.Terminate

[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 * alfa.adb, alfa.ads

[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 assign.adb:8:

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, a

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 > > * gcc/ada/gcc-interface/Makefile.in (kfreebsd%): > - use s-taprop-posix.ad[bs] instead of s-taprop-linux.ad[bs]

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

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

[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 tasking.ads:6:1

[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 * make.adb

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

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

[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] Get rid of break_start

2011-08-04 Thread Arnaud Charlet
This could be used by the debugger to stop the execution before starting the main subprogram, but no debugger use it. No testcase as there is no functionnal change. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Tristan Gingold * bindgen.adb: Remove code the reference o

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

[Ada] In ALFA mode, do not generate fully qualified names in frontend

2011-08-04 Thread Arnaud Charlet
ALFA mode is for formal verification, which needs to postpone full name qualification after some processing. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Yannick Moy * frontend.adb (Frontend): only qualify names in non-ALFA mode Index: frontend.adb ===

[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, a

[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. Tes

[Ada] AI05-0115: aggregates with invisible components.

2011-08-04 Thread Arnaud Charlet
If a type has an ancestor derived from a private view of its parent, the type may have invisible components and aggregates cannot be written for it. This is an Ada2012 binding interpretation. Compilation of pak1-pak3.adb below must yield: predicatek1-pak3.adb:6:15: no selector "C1" fo

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

[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 * alfa.ads (ALFA_Xref_Record): add component for

[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 * lib-xref-alfa.adb (Add_ALFA_Xrefs): correct definition of r

[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 * exp_prag.adb (Expand_Pragma_Check

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

[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 * frontend.adb (Frontend): remove previous patc

[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 * cstand.adb: Add Informati

[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 * s-tassta.adb (Task_Wrapper): Rewrite the dynamic stack u

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

[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 * sem_prag.adb (Check_Arg_Is_String_Literal): remove useless procedure (Analyze_Pragma): allow static string expression for name of Test_Case,

[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 * lib-xref-alfa.adb (

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

[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 * sem_ch12.adb (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration, Analyze_Package_I

[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 * bindgen.adb (Gen_Adainit_C): Remove. (Gen_Adafinal_C): Ditto. (Gen_E

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

[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 * sem_attr.adb (Analyze_Attribute): Replace the message "invisible attribute of}" of the spark

[Ada] AI05-0069 : Holder container

2011-08-04 Thread Arnaud Charlet
This AI defines a package Ada.Containers.Indefinite_Holders in order to create the ability to hold a single object of an indefinite type. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Vadim Godunko * impunit.adb (Non_Imp_File_Names_12): Add "a-coinho". * a-coin

[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 tools,

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 pro

[Ada] Do not generate wrong transient scopes for pragma check in ALFA mode

2011-08-05 Thread Arnaud Charlet
In formal verification mode, pragma check and enclosed expression are not expanded, so no transient scope should be introduced for a pragma check as a result of the introduction of temporary variables during expansion. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Yannick Moy

[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 * adaint.c (__gnat_set_writable, __gnat_set_readable, __gnat_se

[Ada] update gnatmake usage

2011-08-05 Thread Arnaud Charlet
Switches --create-map-file and --create-map-file- 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 * makeusg.adb: Add lines for --create-map-file switches.

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

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

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

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

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

[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. T

[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 * sem_type.adb (Specific_Type): in an

[Ada] Generalized indexing in Ada2012

2011-08-05 Thread Arnaud Charlet
Ada2012 introduces a general indexing mechanism, using implicit dereference and new aspects Constant_Indexing and Variable_Indexing. The following must compile and execute quietly in Ada_2012 mode: with Index1; use Index1; procedure Test_Index1 is Obj : Container (15) := (15, T => (others => -

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

[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 * lib-xref-alfa.adb (Collect_ALFA): generate the proper relation betwee

[Ada] Improve flag positioning for missing quote when comma present

2011-08-05 Thread Arnaud Charlet
This patch improves the positioning for the case of a missing string quote when a comma is the likely intended end of the string, as shown by this example: 1. procedure mquote is 2. begin 3.Error_Msg_NE ("this is a string with missing quote, N, E);

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

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

[Ada] Correct unique name of entities for formal verification

2011-08-05 Thread Arnaud Charlet
As some entities end up with an unqualified name, for example for the declaration of a library-level subprogram, the name given by Unique_Name should match the qualified name. Now corrected. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-05 Yannick Moy * sem_util.adb (Uniqu

[Ada] Add new Assign and Copy operations to unbounded containers

2011-11-04 Thread Arnaud Charlet
The new operations Assign and Copy have been added to the (already-existing) unbounded containers, to achieve parity with the same operations in the newer bounded forms, described in AI05-0001. This facilitates changing one container form to the other during program maintenance. The text of AI05-0

[Ada] Detect more cases of Long_Float inconsistencies at compile time

2011-11-04 Thread Arnaud Charlet
This patch causes more cases of inconsistent use of pragma Long_Float to be caught at compile time. This gives better messages earlier, and also avoids some blowups due to inconsistent usage. The following is pkg1.adb compiled with -gnatdm -gnatld7 -gnatj60 Compiling: pkg1.adb 1. package bo

[Ada] Add case-insensitive string operations

2011-11-04 Thread Arnaud Charlet
Ada 2012 added case-insensitive string operations for hashing (Hash_Case_Insensitive), tests for equality (Equal_Case_Insensitive), and tests for lexicographical order (Less_Case_Insensitive), per AI05-0001. The text of AI05-0001 can be found here: http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s

[Ada] Atomic_Synchronization applies to types as well as variables

2011-11-04 Thread Arnaud Charlet
This patch corrects an oversight in the previous checkin for handling Atomic_Synchronization. This applies to types as well as to variables. 1. pragma Disable_Atomic_Synchronization; 2. procedure AtSyncT is 3.type Int is new Integer; 4.pragma Atomic (Int); 5.X

[Ada] Extend atomic synchronization handling to selections

2011-11-04 Thread Arnaud Charlet
This patch extends atomic synchronization to selected components and explicit dereferences when the result is a type for which atomic sync is enabled. Also it handles the case of an indexed selection from an array with atomic components. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-11-0

[Ada] Semantically analyze source aspect in ASIS mode

2011-11-04 Thread Arnaud Charlet
In ASIS mode, the source aspect for Pre/Post/Test_Case should be semantically analyzed, as this is the node that is read by ASIS tools. This does not occur in normal compilation mode, as the source aspect is first rewritten in a pragma, and the pragma is analyzed instead. Now, the source aspect is

[Ada] Create the Find_Name_In_Path helper

2011-11-04 Thread Arnaud Charlet
This is a preliminary work. Add a subprogram in the Prj.Env package so that it is possible to search in a project path. No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-11-04 Tristan Gingold * prj-env.adb, prj-env.ads (Find_Name_In_Path): New function, from

[Ada] Add Generic_Sort operation to standard library

2011-11-04 Thread Arnaud Charlet
Ada 2012 added a generic operation for sorting an anonymous array (or array-like container), named Ada.Containers.Generic_Sort, per AI05-0001. The text of AI05-0001 can be found here: http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0001-1.txt Tested on x86_64-pc-linux-gnu, committed on tru

[Ada] Further refinement to Atomic_Synchronization handling

2011-11-04 Thread Arnaud Charlet
This patch cleans up and reorganizes the handling of atomic sync, and fixes some inconsistencies, e.g. an attribute reference was properly excluded for an identifier, but not for a selected component. Also the flag Atomic_Sync_Required is now on the selected component node itself not the selector n

[Ada] Further work on atomic synchronization

2011-11-04 Thread Arnaud Charlet
This makes the compiler detect one more case needing atomic synchronization, namely a pragma Atomic on a component with a predefined type. And this also excludes a few more cases not needing it. The compiler should issue the warning with -gnatw.n -gnatld7 -gnatj60 on: procedure Synccomp is typ

[Ada] Change semantics of Merge

2011-11-04 Thread Arnaud Charlet
The semantics of Merge changed slightly per AI05-0021. It was originally the case that if Target and Source denoted the same container object, then the GNAT implementation of Merge did nothing. However, it was argued that RM05 did not precisely specify the semantics for this corner case. The decisi

[Ada] Message on rewriting loops is now an info message

2011-11-04 Thread Arnaud Charlet
This patch changes the message for rewriting loops into an info message (really no reason to give a warning!). The following test was compiled with -gnatld7 -gnatj60 1. procedure SCOGoto is 2.X : Integer; 3. begin 4.X := 1; 5.<> | >>> info: c

[Ada] Cleanup -gnatG output for machine code

2011-11-04 Thread Arnaud Charlet
This patch cleans up a minor glitch of outputting an extra semicolon after the code statement appearing as the expression of an Asm construct when using machine code. The following is compiled on an x86 with -gnatG 1. with system.machine_code; use system.machine_code; 2. procedure repro

[Ada] Inhibit exception push/pop when not needed

2011-11-04 Thread Arnaud Charlet
This patch inhibits the generation of exception push/pop nodes if restriction No_Exception_Handlers is active (when they are always useless), or in CodePeer mode (where they are never needed and can intefere with the analysis). The following program 1. pragma Restrictions (No_Exception_Propa

Re: [Ada] Inhibit exception push/pop when not needed

2011-11-04 Thread Arnaud Charlet
>> This patch inhibits the generation of exception push/pop nodes if >> restriction No_Exception_Handlers is active (when they are always >> useless), or in CodePeer mode (where they are never needed and can >> intefere with the analysis). > > this latest series breaks bootstrap on at least i686-d

[Ada] Update dependencies

2011-11-04 Thread Arnaud Charlet
Fixes the build failure reported by Iain Sandoe on parallel builds. * gcc-interface/Make-lang.in: Update dependencies. Index: gcc-interface/Make-lang.in === --- gcc-interface/Make-lang.in (revision 180935) +++ gcc-interface/

[Ada] Define unique entity for parameter (used in Alfa mode)

2011-11-07 Thread Arnaud Charlet
For the formal verification backend, to be used in Alfa mode, define the unique entity representing a parameter. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-11-07 Yannick Moy * sem_util.adb (Unique_Entity): For a parameter on a subprogram body that has a correspondi

[Ada] Iteration over class-wide containers

2011-11-07 Thread Arnaud Charlet
In Ada2012 some aspects on tagged types are inherited, and apply to the class wide type as well. Among these are the Default_Iterator and Iterator_Element aspects. These allow iterations over class-wide objects, e.g. in pre- or post- conditions. Tested on x86_64-pc-linux-gnu, committed on trunk 2

[Ada] In Alfa mode, record also modifications not coming from source

2011-11-07 Thread Arnaud Charlet
Alfa mode is meant for formal verification, in which we must gather all modifications to variables, even those not coming from source. This is in particular the case for rewritings of renamings in Alfa mode. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-11-07 Yannick Moy * se

[Ada] Improve error msg for passing volatile to non-volatile

2011-11-07 Thread Arnaud Charlet
This patch provides a minor improvement to an error message. This is compiled with -gnatld7 -gnatws -gnatj60: 1. procedure VolNVol is 2.type R is tagged null record; 3.procedure Q (A : R) is 4.begin 5. null; 6.end; 7.V : R; 8.pr

Re: PING 1 [Patch Ada RFA] make sure that multilibs are built with correct s-oscons.ads

2011-11-09 Thread Arnaud Charlet
> * Iain Sandoe, 2011-11-07 : > > > Subject: PING 1 [Patch Ada RFA] make sure that multilibs are built with > > correct s-oscons.ads > > Patch looks fine to me. It's an official 'OK' then.

<    7   8   9   10   11   12   13   14   15   16   >