[Ada] Spurious ineffective use_clause warning on class-wide type

2017-11-08 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby the use of a class-wide type's primitive did not lead to its base type being recognized as effective - causing to spurious use_clause warnings. Additionally, class-wide types used as generic actuals were not checked in certain cases due to not being flagged as p

[Ada] Missing categorization check on generic subprogram body

2017-11-08 Thread Pierre-Marie de Rodat
This patch adds a categorization check on a generic subprogram body, so that the compiler can reject a generic subprogram marked Pure if its body depends on an impure unit. Compiling gf.adb must yield: gf.adb:2:06: cannot depend on "Impure" (wrong categorization) gf.adb:2:06: pure unit cann

[Ada] Continue decontruction of SPARK frontend cross-references

2017-11-08 Thread Pierre-Marie de Rodat
While traversing the AST to collect SPARK cross-references (which are used to synthesize Global contracts for code with SPARK_Mode => Off), we always traverse body stubs. There is no need to configure this by a parameter. The modified code is only executed as part of GNATprove. Behaviour unchanged

[Ada] Ignore file and unit names when collecting SPARK cross-references

2017-11-08 Thread Pierre-Marie de Rodat
Human-readable file and unit names in SPARK cross-references were only needed to make the ALI file human-redable. They are now removed (but can be added to the debug routine dspark if needed). Modified code is only executed as part of GNATprove, so no impact on the frontend. Behaviour unaffected,

[Ada] Implementation of AI12-0127 : delta aggregate

2017-11-08 Thread Pierre-Marie de Rodat
This patch updates the implementation of Ada2020 delta aggregates, so they can be used in the context of a private extension of a record type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-11-08 Ed Schonberg * sem_ch4.adb (Analyze_Aggregate): For Ada2020 delta aggre

[Ada] Accessibility violation flagged on anonymous access component

2017-11-08 Thread Pierre-Marie de Rodat
The compiler was incorrectly generating an unconditional raise of Program_Error (and associated warnings) for returning a component with an anonymous access type within a function of a generic instance. The code that was performing this check was intended to apply only to anonymous access discrimi

[Ada] Crash on access-to-object in SPARK

2017-11-08 Thread Pierre-Marie de Rodat
This patch corrects the light expansion of object renamings for SPARK to prevent a crash by querying the subtype mark when the renaming carries an access definition. - -- Sources -- - -- p.ads package P with SPARK_Mode is type T is record Ptr : access constant I

[Ada] Warn on missing deallocation of coextension

2017-11-08 Thread Pierre-Marie de Rodat
This patch adds an informational warning to alert the user to the fact that GNAT currently mishandles coextensions and that they will not be finalized or deallocated with their respective owners in some as they should according to RM 13.11.2 (9/3). -- Source -- -- types

[Ada] Implementation of AI12-0127 : delta aggregate

2017-11-08 Thread Pierre-Marie de Rodat
This patch updates the implementation of Ada2020 delta aggregatesa to conform to the latest version of AI12-0127. this patch adds checks to reject statically delta aggregates that specify values for components that appear in different variants of a record type. Compiling test2.adb in Ada2020 mode

[Ada] Spurious warning about unreferenced formal with implicit dereference

2017-11-09 Thread Pierre-Marie de Rodat
This patch removes a spurious warning about an unused formal parameter when the type of the psrameter has an Implicit_Dereference aspect and the parameter is used in a call wthin the subbprogram body. The following must compile quietly: gcc -c -gnatwa tr.adb --- with Con; package Tr is pro

[Ada] Improve layout ABI compatibility with C++

2017-11-09 Thread Pierre-Marie de Rodat
This patch modifies the initialization of the offset_to_top field of secondary dispatch tables to store negative offsets, thus improving the layout compatibility of secondary dispatch tables with C++. No functionality change. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Javier M

[Ada] pragma Warnings (Off) disabled if warning treated as error

2017-11-09 Thread Pierre-Marie de Rodat
The filtering of warnings set by pragma Warnings (Off) may be disabled if an unfiltered warning is issued by the compiler and this warning is treated as an error, e.g. by means of -gnatwe. This behavior clearly goes against the Principle of Least Surprise and is therefore changed. The following p

[Ada] Spurious warning on elaboration issue in dead code

2017-11-09 Thread Pierre-Marie de Rodat
This patch updates the new ABE mechanism to fully remove a recorded top level elaboration scenario from its data structures when the scenario appears in dead code. Previously the mechanism suppressed the generation of checks for such a scenario, but still produced warnings. Tested on x86_64-pc-lin

[Ada] Adjust wording of error message to match the SPARK RM wording

2017-11-09 Thread Pierre-Marie de Rodat
Rule 7.2.6(2) of the SPARK RM uses the word "denote". Now the error message that implements this rule also uses word "denote" and not "designate". Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Piotr Trojanek * sem_prag.adb (Analyze_Part_Of): Change "designate" to "denot

[Ada] Warn on missing finalization of anonymous access-to-controlled

2017-11-09 Thread Pierre-Marie de Rodat
trunk gcc/ada/ 2017-11-09 Justin Squirek * sem_res.adb (Resolve_Allocator): Add warning messages corresponding to the allocation of an anonymous access-to-controlled object. gcc/testsuite/ 2017-11-09 Pierre-Marie de Rodat * gnat.dg/controlled2.adb, gnat.dg/controlled

[Ada] Crash on SPARK_Mode with illegal mode

2017-11-09 Thread Pierre-Marie de Rodat
This patch modifies the processing of aspect or pragma SPARK_Mode to avoid a crash when the annotation appears with an illegal mode. -- Source -- -- pack.ads package Pack is package Nested_1 with SPARK_Mode => False is end Nested_1; Obj : constant String := "

[Ada] Misleading error or crash on illegal call with limited view

2017-11-09 Thread Pierre-Marie de Rodat
This patch provides a proper diagnostic on an illegal call to a function whose return type is a limited view, when the call appears in a unit whose context does not include the non-limited view of the type. Prior to this patch the compiler reports a misleading error about a missing discriminant, or

[Ada] use_clauses sometimes ignored in generic template

2017-11-09 Thread Pierre-Marie de Rodat
This patch prevents spurious visibility errors due to use_clauses being ignored when analyzing entities within a generic instance's template. -- Source -- -- gnatcoll-json-support-test-test_vectors-integer_vectors-json.ads with GNATCOLL.JSON.Support.Ada.Containers.Vect

[Ada] Cleanup of Namet

2017-11-09 Thread Pierre-Marie de Rodat
CodePeer detected some questionable code in the Namet package. This patch cleans it up. No actual bugs, but some dead code was detected. The main impact of this patch is to clarify which subprogram parameters are allowed to be the special "null"-ish Name_Id values (almost none). No change in compil

[Ada] Fix code quality issues reported by CodePeer

2017-11-09 Thread Pierre-Marie de Rodat
Running CodePeer on GNAT frontend codebase revealed a number of code quality issues. For the most part, these are not bugs, but could lead to bugs during maintenance. A few could lead to reads of uninitialized variables. This patch fixes these issues in various ways: - add initialization in cases

[Ada] Fix false positive of -gnatw.x on trivial instantiation

2017-11-09 Thread Pierre-Marie de Rodat
As for calls, issuing the -gnatw.x warning on every generic instantiation results in way too many false positives and thus needs to be stopped. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Eric Botcazou * exp_ch11.adb (Possible_Local_Raise): Do not issue the warning fo

[Ada] Spurious error on read of out parameter in Ada_83 mode

2017-11-09 Thread Pierre-Marie de Rodat
This patch fixes a regression in the handling of out parameters that appear as the prefix of an attribute, when compiling in Ada_83 mode. Such implicit read operations are legal in Ada_83 when the parameter is of an array type and the attribute yields bound information. Tested on x86_64-pc-linux-g

[Ada] Spurious error on pragma Unreferenced

2017-11-09 Thread Pierre-Marie de Rodat
This patch suppresses the light expansion of references denoting renamings that act as arguments in pragmas Unmodified and Unreferenced for GNATprove. In general, the compiler replaces references to renamings with the renamed name, however certain references are left as is for GNATprove. This does

[Ada] Restriction Static_Dispatch_Tables

2017-11-09 Thread Pierre-Marie de Rodat
This patch implements a new GNAT restriction named Static_Dispatch_Tables, which is intented to prevent the creation of tagged types whose dispatch tables cannot be placed in read-only memory. The following test now compiles with errors. pragma Restrictions (Static_Dispatch_Tables); procedure Te

[Ada] Fix code quality issues reported by CodePeer at level 3

2017-11-09 Thread Pierre-Marie de Rodat
Rerunning CodePeer at level 3 revealed further missing initializations (not errors, but good to add for maintenance and to improve analysis results) and missing No_Return pragmas. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Yannick Moy * sem_attr.adb (Analy

[Ada] Rewrite code and add justifications for static analysis

2017-11-09 Thread Pierre-Marie de Rodat
CodePeer static analyzer issues messages that can be avoided by simpliflying the code, or justifying the false positives. There is no test, as this does no impact the behavior of the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Yannick Moy * erroutc.adb (Outp

[Ada] Get rid of warnings about uninitialized variables

2017-11-09 Thread Pierre-Marie de Rodat
This patch cleans up the code to get rid of warnings about uninitialized variables. No change in behavior; no test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Bob Duff * exp_ch4.adb, exp_ch9.adb, exp_prag.adb, par-ch3.adb, sem_aggr.adb, sem_ch12.ad

[Ada] Crash on use of Compile_Time_Error in a generic package

2017-11-09 Thread Pierre-Marie de Rodat
An expanded name used within a generic package declaration must be handled specially because the prefix may denote a parent unit that will have a different name in an instance. We introduce a renaming of the generic unit and replace the expanded name with a reference to that renaming, The renaming

[Ada] Bump size limit for large static aggregates

2017-11-09 Thread Pierre-Marie de Rodat
For historical reasons, the compiler caps the size of large static aggregates that are emitted as static data in the object file. If they exceed the cap, then elaboration code is generated instead, but this is in most cases slower, yields bigger and unoptimizable code with poor run-time performanc

[Ada] Fix bootstrap issue with CodePeer justifications

2017-11-09 Thread Pierre-Marie de Rodat
The use of pragma Annotate to justify CodePeer messages breaks compiler bootstrap. Fix this by removing these justifications. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Yannick Moy * erroutc.adb, set_targ.adb: Remove pragma Annotate for CodePeer justification

[Ada] Quadratic explosion caused by freezing of contracts

2017-11-09 Thread Pierre-Marie de Rodat
This patch reimplements the "freezing of contracts" semantic because it caused a quadratic exlosion in the number of subprogram bodies in declarative lists. The "freezing of constracts" semantic is carried out when an entry, package, protected, subprogram [stub], or task body is processed. Prior t

[Ada] Export Make_Independent from GNAT.Threads

2017-11-09 Thread Pierre-Marie de Rodat
This patch exports Make_Independent from GNAT.Threads. No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Bob Duff * libgnarl/g-thread.ads, libgnarl/g-thread.adb: (Make_Independent): Export this so users can use it without importing

[Ada] Variable reads and writes

2017-11-09 Thread Pierre-Marie de Rodat
This patch adds processing for N_Variable_Reference_Marker nodes to the transformation phase of gigi. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Hristian Kirtchev * gcc-interface/trans.c (gnat_to_gnu): Add processing for N_Variable_Reference_Marker nodes. In

Re: [PATCH] [PR82155] Fix crash in dwarf2out_abstract_function

2017-11-15 Thread Pierre-Marie de Rodat
Hello Richard, On 09/25/2017 01:54 PM, Richard Biener wrote: Ok for trunk and gcc-7 branch after a while. Is it still okay to commit to gcc-7, now? -- Pierre-Marie de Rodat

Re: [PATCH] [PR82155] Fix crash in dwarf2out_abstract_function

2017-11-15 Thread Pierre-Marie de Rodat
On 11/15/2017 12:16 PM, Richard Biener wrote: Is it still okay to commit to gcc-7, now? Yes. Done. Thank you! -- Pierre-Marie de Rodat

[Ada] Spurious ineffective use_clause warning on use in boolean condition

2017-11-16 Thread Pierre-Marie de Rodat
This patch prevents spurious ineffective use_clause warnings in certain cases due to the possible rewritting of nodes within boolean expressions. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-16 Justin Squirek * sem.adb (Analyze): Remove requirement that the original node

[Ada] Compiler abort or infinite loop in malformed declaration

2017-11-16 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort (or an infinite loop in a compiler whose internal assertions are not enabled) when the subtype indication in an object declaration does not denote a type. Syntactically this may happen when the subtype indication is missing altogether and the expression in the decl

[Ada] Disallow renamings declaring tagged primitives

2017-11-16 Thread Pierre-Marie de Rodat
This patch implements the following SPARK rules from SPARK RM 6.1.1(3): A subprogram_renaming_declaration shall not declare a primitive operation of a tagged type. -- Source -- -- renamings.ads package Renamings with SPARK_Mode is type T is tagged null record

[Ada] Crash on early call region of SPARK subprogram body

2017-11-16 Thread Pierre-Marie de Rodat
This patch accounts for the case where the early call region of a subprogram body declared in a package body spans into the empty corresponding spec due to pragma Elaborate_Body. -- Source -- -- gnat.adc pragma SPARK_Mode (On); -- pack.ads package Pack with Elaborat

[Ada] Fix more precise mode for parameter

2017-11-16 Thread Pierre-Marie de Rodat
CodePeer analysis of GNAT showed that a parameter was not read and always set on all paths, making it an out rather than an in-out. This was not detected by the compiler, because one path ends up raising an exception, which is not taken into account in the simpler analysis done in GNAT. Tested on

[Ada] Disallow renamings declaring tagged primitives

2017-11-16 Thread Pierre-Marie de Rodat
This patch enables the check which ensures that a subprogram renaming does not declare a primitive operation of a tagged type in instantiations. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-16 Hristian Kirtchev * sem_ch8.adb (Check_SPARK_Primitive_Operation): Enable the c

[Ada] Allow calls to Is_CCT_Instance for records

2017-11-16 Thread Pierre-Marie de Rodat
Routine Is_CCT_Instance (where CCT stands for Current Concurrent Type) is now used in the SPARK backend for checking references to the current type instance within default expressions of discriminants and components of (single) concurrent units. The same backend code was already used for similar r

[Ada] Spurious error on System'To_Address in -gnatc mode

2017-11-16 Thread Pierre-Marie de Rodat
This patch fixes a bug where if an address clause specifies a call to System'To_Address as the address, and the code is compiled with the -gnatc switch, the compiler gives a spurious error message. The following test should compile quietly with -gnatc: gcc -c -gnatc counter.ads with System; pac

[Ada] Handling of elaboration warnings

2017-11-16 Thread Pierre-Marie de Rodat
This patch modifies the elaboration warnings produced by the ABE mechanism to depend on the status of flag Elab_Warnings. The flag is enabled by compilation switch -gnatwl. This change allows for selective suppression of warnings, as well as total suppression. In order to preserve the behaviour of

[Ada] Improper visibility of loop parameter with Iterable aspect

2017-12-05 Thread Pierre-Marie de Rodat
This patch fixes a visibility bug in the expansion of a loop over an object whose type carries the GNAT-specific Iterable aspect. Prior to this patch, the loop variable remained visible after exit from the loop. Compiling iterator_test.adb must yield: iterator_test.adb:26:61: "number" is not v

[Ada] Propagate SLOC in iteration over array

2017-12-05 Thread Pierre-Marie de Rodat
Expand_Iterator_Loop_Over_Array turns a loop over an array: for Element of Array loop into a loop with an explicit iteration variable, but it doesn't propagate the SLOC of Element onto the new iteration variable. This results in inaccurate information when precise coverage is requested, as t

[Ada] Fix handling of load addresses for backtraces through SO

2017-12-05 Thread Pierre-Marie de Rodat
The processing of shared library load addresses for backtrace symbolization suffers from disconnects between various parts in the runtime library regarding where run-time vs shared-object-file-relative addresses are at hand. At some points the code processes a local copy of each address coming fro

[Ada] Fix end-of dwarf section detection in address symbolizer

2017-12-05 Thread Pierre-Marie de Rodat
When executing a Line Number program statement, the state machine bails out a few bytes before the current offset reaches the end of section to account for possible padding bytes at the end. The current test is checking if current_offset + 4 >= section_length, which is too early for e.g. a program

[Ada] Fix indirect calls to imported subprograms within generic

2017-12-05 Thread Pierre-Marie de Rodat
Our trampoline avoidance scheme based on subprogram descriptors should always be disconnected for subprograms with foreign convention. For access to subprogram subtypes, the Set_Convention front-end procedure is expected to take care of this, but it currently only does so for subtypes not within a

[Ada] Warn on weal elaboration model for SPARK

2017-12-05 Thread Pierre-Marie de Rodat
This patch introduces a check which ensures that SPARK elaboration code is processed using the static elaboration model as it guarantees the highest degree of safety. -- Source -- -- spark_pack.ads package SPARK_Pack with SPARK_Mode is pragma Elaborate_Body; typ

[Ada] Reject properly an aspect Predicate on a formal type

2017-12-05 Thread Pierre-Marie de Rodat
This patch adds a check to reject an aspect Predicate on a formal type declaration. Compiling gen.adb must yield: gen.ads:2:55: predicate cannot apply to formal type --- generic type T is array (Integer range <>) of Integer with Predicate => T'First /= 1; function Gen return Integer

[Ada] Improve debugging of task type discriminants

2017-12-05 Thread Pierre-Marie de Rodat
This patch improves the debugging information generated by the compiler for task discriminant. No test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-12-05 Javier Miranda * exp_ch9.adb (Install_Private_Data_Declarations): Add missing Debug_Info_Needed decor

[Ada] Spurious error with private overriding of overloaded subprogram

2017-12-05 Thread Pierre-Marie de Rodat
This patch fixds a spurious error report on a prefixed call where the operation is a private overriding of a visible operation, and the operation has various overloadings in the visible and private parts. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-05 Ed Schonberg

[Ada] Fix inconsistent usage of Machine in s-fatgen.adb

2017-12-15 Thread Pierre-Marie de Rodat
System.Fat_Gen is a generic unit implementing support routines for floating- point attributes, for example the 'Machine attribute. These routines make themselves use of the 'Machine attribute, some of them by calling the Machine support routine directly, some others by using the attribute. Consis

[Ada] Ignore external calls from instances for elaboration

2017-12-15 Thread Pierre-Marie de Rodat
This patch restores the functionality of debug switch -gnatdL to the behavior prior to revision 255412. The existing behavior has been associated with switch -gnatd_i. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Hristian Kirtchev * debug.adb: Move the funct

[Ada] Completing expression function need not trigger loading of package body

2017-12-15 Thread Pierre-Marie de Rodat
This patch prevents expression functions which complete previous declarations in a package spec from loading the body of the package spec on the basis that the expression function body is needed for inlining. This in turn prevents the generation of spurious dependencies on units in ALI files. Test

[Ada] Compiler crash with -gnatd.1 (force unnesting of subprograms)

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash in the compiler when enabling unnesting of subprograms on a generic unit. The following must compile quietly: gcc -c -gnatg -gnatd.1 a-btgbso.adb Tested on x86_64-pc-linux-gnu, committed on trunk 2017-12-15 Ed Schonberg * exp_unst.adb (Unnest_Subprograms): N

[Ada] Crash on subprogram instantiation in nested package

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash on a subpogram instance that appears within a package that declares the actual type for the instance, when the corresponding type is a private or incomplete formal type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada 2017-12-15 Ed Schonberg * sem_c

[Ada] Spurious warning on default initialized object

2017-12-15 Thread Pierre-Marie de Rodat
This patch updates the implications that pragma Default_Initial_Condition has on full default initialization of objects and types. According to the SPARK RM, the pragma may appear without an expression 7.3.3 The aspect_definition may be omitted; this is semantically equivalent to speci

[Ada] Optimizing allocators for arrays with non-static upper bound

2017-12-15 Thread Pierre-Marie de Rodat
This patch extends the optimization of allocators for arrays of non-controlled components, when the qualified expression for the aggregate has an unconstrained type and the upper bound of the aggregte is non-static. In this case it is safe to build the array in the allocated object, instead of firs

[Ada] Reject certain constants as constituents

2017-12-15 Thread Pierre-Marie de Rodat
This patch updates the analysis of pragma Refined_State to reject constants which are used as refinement constituents and are either * Part of the visible state of a package * Part of the hidden state of a package, and lack indicator Part_Of. -- Source -- -- var

[Ada] Crash on expression function and discriminant-dependent component

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash on an expression function that is a completion, when the return expression includes a reference to a discriminant-dependent component. An expression function that is a completion freezes all types referenced in the expression, but some itypes are excluded because they are f

[Ada] Verify Part_Of indicator in non-SPARK code

2017-12-15 Thread Pierre-Marie de Rodat
This patch modifies the analysis of Part_Of indicators to verify their associated rules even when the indicator appears in non-SPARK code. This prevents possible tamperings of Part_Of constituents of single concurrent types outside of SPARK code. -- Source -- -- pack.ad

[Ada] Missing error on illegal initialization item

2017-12-15 Thread Pierre-Marie de Rodat
This patch modifies the analysis of pragma Initializes to detect an illegal null initialization item. -- Source -- -- remote.ads package Remote is Y : Integer := 0; end Remote; -- pack.ads with Remote; package Pack with SPARK_Mode, Initializes => (nul

[Ada] Fix incorrect assignment to array with Component_Size clause

2017-12-15 Thread Pierre-Marie de Rodat
This change fixes a wrong translation of the assignment of an aggregate made up of a single Others choice to an array whose nominal size of the component type is the storage unit and which is subject to a Component_Size clause that effectively bumps this size. The compiler was generating a call to

[Ada] Spurious error and missing warning on static predicate

2017-12-15 Thread Pierre-Marie de Rodat
This patch handles properly a static predicate on a scalar type that is trivially true. Previous to this patch the compiler rejected the predicate on the incorrect grounds that it was not a static expression. Compiling bad_days.ads must yield: bad_days.ads:4:34: warning: predicate is redundant

[Ada] Concurrent types in pragma Initializes

2017-12-15 Thread Pierre-Marie de Rodat
Concurrent types and single concurrent types can now appear in the input list of pragma Initializes as long as the type encloses the pragma. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Hristian Kirtchev * sem_prag.adb (Analyze_Input_Item): Allow concurrent t

[Ada] Spurious 'W' ALI line due to implicit with clause

2017-12-15 Thread Pierre-Marie de Rodat
This patch "fixes" an issue where an implicit with clause generated to emulate an implicit Elaborate[_All] pragma appears on a 'W' line in the ALI file. As a result, the 'W' line may introduce a spurious build dependency in GPRbuild. -- Source -- -- func.ads function F

[Ada] Spurious error on equality operator on incomplete type

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on a declaration for an equality operator whose operands have an incomplete type, when the same declarative oart includes another such equality operator on another incomplete type which is used as an actual in an earlier instantiation. Tested on x86_64-pc-linux-gn

[Ada] Spurious alias error on access to array indexed by non-standard enum

2017-12-15 Thread Pierre-Marie de Rodat
This patch prevents the propagation of spurious errors about the prefix of access being non-aliased when getting the access to an array indexed by an enumeration with a custom representation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Justin Squirek * sem_a

[Ada] Added warning on membership tests

2017-12-15 Thread Pierre-Marie de Rodat
RM 4.5.3 (28) specifies that (except for records and limited types) a membership operation uses the predefined equality, regardless of whether user-defined equality for the type is available. This can be confusing and deserves a new warning. Compiling code.adb must yield: code.adb:19:42: warnin

Re: [wwwdocs] readings.html - libre.adacore.com is gone

2018-01-08 Thread Pierre-Marie de Rodat
On 01/08/2018 01:39 AM, Gerald Pfeifer wrote: ...so adjust to where it redirects. Applied. Ah, good catch. Thank you Gerald! -- Pierre-Marie de Rodat

[Ada] Misleading warning on unresolvable package name

2018-05-28 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby the compiler misidentified a package name containing the name of a standard runtime package as said package - leading to and improper error message prompting the user to "With" a package already in scope. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-

[Ada] Further evaluation of type bounds in GNATprove mode

2018-05-28 Thread Pierre-Marie de Rodat
Some static bounds of types are not recognized and evaluated as such in the semantic analysis phase of the frontend, which leads to incomplete information in GNATprove. Fix that in the GNATprove mode only, as this is not needed when full expansion is used. There is no impact on compilation. Teste

[Ada] Warning on recursive call within postcondition

2018-05-28 Thread Pierre-Marie de Rodat
This patch adds a warning to a function call that appears within a postcondition for said function. This may mean an omission of an attribute reference 'Result, and may lead to an infinite loop on a call to that function. Compiling post_error.ads must yield: post_error.ads:3:11: warning:

[Ada] Minor tweak to output of -gnatR

2018-05-28 Thread Pierre-Marie de Rodat
This changes the output of -gnatR for extensions of tagged record types to avoid displaying the internal _Parent component, which overlaps with other components and is thus more confusing than helpful. For the following hierarchy: type R1 is tagged record I : Integer; end record; type

[Ada] Crash on aspect/pragma Linked_Section with -gnatR2

2018-05-28 Thread Pierre-Marie de Rodat
This patch modifies the output of the representation information related to aspect or pragma Linker_Section, achieved with compiler switch -gnatR2. The value of the section argument is now properly retrieved. Previously it was assumed that the value is always a N_String_Literal, however the semanti

[Ada] Spurious constraint error on array of null-excluding components

2018-05-28 Thread Pierre-Marie de Rodat
This patch fixes an issue whereby the compiler would raise spurious runtime errors when an array of null-excluding components was initialized with an expression which required the secondary stack (such as with an concatination operation) due to certain generated checks which were incorrected perfor

[Ada] Spurious error on aspect Volatile

2018-05-28 Thread Pierre-Marie de Rodat
This patch modifies the analysis of aspect/pragma Volatile to correct accept the annotation when it applies to single protected and single task types, and SPARK_Mode On is in effect. -- Source -- -- pack.ads package Pack with SPARK_Mode is protected PO_Aspect with V

[Ada] Fix internal error on nested record types with representation clause

2018-05-28 Thread Pierre-Marie de Rodat
This fixes a long-standing issue with the expansion of equality functions generated for discriminated record types with variant part. In this case the front-end recursively expands equality functions for the composite sub-components, in particular the array sub-components. But it systematically u

[Ada] Better accuracy in float-to-fixed conversions

2018-05-28 Thread Pierre-Marie de Rodat
This patch improves the accuracy of conversions from a floating point to a fixed point type when the fixed point type has a specified Snall that is not a power of two. Previously the conversion of Fixed_Point_Type'First to some floating point number and back to Fixed_Point_Type raised Constraint er

[Ada] Fix internal error on renaming of equality for record type

2018-05-28 Thread Pierre-Marie de Rodat
This adjusts the previous change to the cases where the array type is not yet frozen and, therefore, where Size_Depends_On_Discriminant is not yet computed, by doing the computation manually. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-28 Eric Botcazou gcc/ada/ * exp_ch

[Ada] Update FE check following change in SPARK RM 7.1.3(12)

2018-05-28 Thread Pierre-Marie de Rodat
SPARK Reference Manual changed to accept attributes First, Last and Length as not leading to an evaluation of a part of the prefix object. This is reflected here in the checking code for that rule. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-28 Yannick Moy gcc/ada/ * se

[Ada] Minor cleanup in repinfo unit

2018-05-28 Thread Pierre-Marie de Rodat
This removes the Truth_Andif_Expr and Truth_Orif_Expr codes for expressions handled by the repinfo unit, since they are redundant with Truth_And_Expr and Truth_Or_Expr respectively in this context. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-28 Eric Botcazou

[Ada] Remove Valop from the Repinfo unit

2018-05-28 Thread Pierre-Marie de Rodat
This removes the recently added Valop as redundant. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-28 Eric Botcazou gcc/ada/ * repinfo.adb (List_GCC_Expression): Remove Valop and replace calls to it with calls to Unop.--- gcc/ada/repinfo.adb

[Ada] Preliminary work to avoid full pathnames in ALI files

2018-05-29 Thread Pierre-Marie de Rodat
Normally, ALI files refer to source files using simple names. This allows files to be moved around without disturbing things (causing extra recompilations, etc). However, for configuration files, the full pathname is stored. This patch preparates the code base to store the simple name in this case.

[Ada] Fix irregular output with -gnatRm

2018-05-29 Thread Pierre-Marie de Rodat
The information displayed by -gnatRm was using slightly different naming and formatting conventions than the rest of the -gnatR information with no justification, so this adjusts it for the sake of consistency. For the following package: package P is function F (I : Integer) return Integer;

[Ada] Minor cleanup in repinfo unit

2018-05-29 Thread Pierre-Marie de Rodat
This factors out the various cases where a marker for an unknown value is output by the -gnatR switches. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Eric Botcazou gcc/ada/ * repinfo.adb (Write_Unknown_Val): New procedure. (List_GCC_Exp

[Ada] Factor out worker procedure for -gnatR

2018-05-29 Thread Pierre-Marie de Rodat
This extracts a worker procedure for printing the layout of a single component from List_Record_Layout so as to make the next change more readable. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Eric Botcazou gcc/ada/ * repinfo.adb (List_Component_Layout): New procedure

[Ada] Enhance output of discriminants with -gnatR in JSON mode

2018-05-29 Thread Pierre-Marie de Rodat
This arranges for the Discriminant_Number of discriminants to be output by -gnatR in JSON mode. This number is referenced in symbolic expressions present for offsets and sizes, so its definition is also required for the sake of completeness. Tested on x86_64-pc-linux-gnu, committed on trunk 2018

[Ada] Adjustment of behavior of new -gnatRj switch

2018-05-29 Thread Pierre-Marie de Rodat
This decouples -gnatRj from the destination, either standard output or file, so that it only toggles the format of the representation information. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Eric Botcazou gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat

[Ada] Fix constraint error in Normalize_Pathname

2018-05-29 Thread Pierre-Marie de Rodat
Fix Normalize_Pathname to avoid a constraint error. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Pascal Obry gcc/ada/ * libgnat/s-os_lib.adb (Normalize_Pathname): Fix handling of ".." in the root directory. gcc/testsuite/ * gnat.dg/normalize_pathname

[Ada] Implement machine parsable format for -gnatR output

2018-05-29 Thread Pierre-Marie de Rodat
This adds a new variant to the -gnatR switch, namely -gnatRj, which causes the compiler to output representation information to a file in the JSON data interchange format. It can be combined with -gnatR0/1/2/3/m (but is incompatible with -gnaRe and -gnatRs). The information output in this mode is

[Ada] Add system-vxworks7 variants of system.ads files for Vx7

2018-05-29 Thread Pierre-Marie de Rodat
Based on the Vx6 versions, using a different link spec to accomodate VxWorks 7 specificities, in particular the ability in some configurations to rely on .ctor sections to trigger constructors in kernel modules. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Olivier Hainque gcc/

[Ada] Plug small hole in -gnatR output

2018-05-29 Thread Pierre-Marie de Rodat
The -gnatR switch outputs representation information for locally-defined types but it was skipping those defined in blocks without label, unlike those defined in named blocks. This change plugs this small hole. The following procedure: procedure P is begin declare type R is record I

[Ada] Tighten crtbegin files for VxWorks

2018-05-29 Thread Pierre-Marie de Rodat
Enforce a more explicit distinction of crtbegin objects holding either functions with ctor/dtor attributes or _ctors/_dtors arrays, or none of the two (no array, no attributes). Then allow/enforce different linking strategies for VxWorks 7. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-0

[Ada] Improper behavior of floating-point attributes

2018-05-29 Thread Pierre-Marie de Rodat
This patch fixes an error in the handling of attributes Pred and Succ when applied to the limit values of a floating-point type. The RM mandates that such operations must raise constraint_error, but GNAT generated in most cases an infinite value, regardless of whether overflow checks were enabled.

[Ada] Wrong equality on untagged private type

2018-05-29 Thread Pierre-Marie de Rodat
When a private type declaration T1 is completed with a derivation of an untagged private type that overrides the predefined equality primitive, and the full view of T2 is a derivation of another private type T2 whose full view is a tagged type, the compiler may generate code that references the wro

[Ada] Adjust documentation of -gnatn switch

2018-05-29 Thread Pierre-Marie de Rodat
This changes the wording in the documentation of the -gnatn switch to make it use "units" rather than "modules" and also adjusts the usage message. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-05-29 Eric Botcazou gcc/ada/ * doc/gnat_ugn/building_exec

[Ada] Secondary stack implementation clean up

2018-05-30 Thread Pierre-Marie de Rodat
This patch reimplements the secondary stack runtime support as follows: * The compiler interface remains unchanged. This applies to both types and subprograms used by the compiler to create and manage secondary stacks. * The secondary stack is no longer a doubly linked list of chunks.

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