Re: [Ada] Validity check failure with packed array and pragma

2017-09-18 Thread Pierre-Marie de Rodat
/testsuite/ or is it fine if I just keep the current “New testcase.”? -- Pierre-Marie de Rodat

[Ada] Crash on illegal current instance

2017-09-18 Thread Pierre-Marie de Rodat
If the type_mark of a qualified_expression refers to the current instance of the type, do not crash; instead give a proper error message. This is illegal by RM-8.6(17). The following test should get an error: current_instance_default.ads:2:54: current instance not allowed package

[Ada] Crash on mutable record component with box initialization

2017-09-18 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a record declaration that includes a mutable record component whose default value is an aggregate that includes a box-initialized component whose value depends on a discriminant of the component. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

Re: [Ada] Validity check failure with packed array and pragma

2017-09-19 Thread Pierre-Marie de Rodat
On 09/18/2017 10:09 PM, Eric Botcazou wrote: I'm not sure anyone really cares so it's up to you I'd say. Ok, thanks. Done! Committed as r252971. -- Pierre-Marie de Rodat

Re: [PATCH][2/2] early LTO debug, main part

2017-09-21 Thread Pierre-Marie de Rodat
ump (or alike) can properly parse the line table? -- Pierre-Marie de Rodat

Re: [PATCH] Add comments to struct cgraph_thunk_info

2017-09-18 Thread Pierre-Marie de Rodat
the virtual one. */ bool virtual_offset_p; -- Pierre-Marie de Rodat

[Ada] Detect protected types as program units

2017-10-09 Thread Pierre-Marie de Rodat
Routine Unit_Declaration_Node now recognizes protected types as program units and returns their declaration nodes; previously it returned declaration nodes of the enclosing program units. This was an oversight. -- Source -- -- illegal.ads package Illegal with

[Ada] Warnings for ineffective use clauses unclear

2017-10-09 Thread Pierre-Marie de Rodat
This patch modifies the warnings denoting ineffective use-clauses to be more explicit and user-friendly. -- Source -- -- unused_a.adb with Ada.Text_IO; with Interfaces; procedure Unused_A is use type Interfaces.Unsigned_8; begin Ada.Text_IO.Put_Line ("Hello,

[Ada] Crash on validity check on actual with type conversion

2017-10-09 Thread Pierre-Marie de Rodat
This patch fixes a compiler crash on a function call when validity checks on actuals are enabled (-gnatVi) and the target type is a scalar type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-10-09 Ed Schonberg * exp_attr.adb

[Ada] Crash on actual that is an instance of a generic child unit

2017-10-09 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on an instantiation where the actual for a formal package is an instantiation of a generic child unit. An instantiation freezes its actuals, and in the case of formal packages whose instance includes a body the back-end needs an explicit freeze node for the

[Add] Spurious ambiguity in prefixed call to classwide operation

2017-10-09 Thread Pierre-Marie de Rodat
This patch suppresses a spurious ambiguity error on a prefixed call to an inherited class-wide operation, when the operation also has other visible homonyms in the context. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-10-09 Ed Schonberg *

Re: r253554 - in /trunk/gcc: ada/ChangeLog ada/exp_...

2017-10-10 Thread Pierre-Marie de Rodat
d I thought I committed it but I guess I got confused with my SVN setup. Anyway the fix is now in. Thank you for having reported this! -- Pierre-Marie de Rodat

[Ada] Suppress checks within finalizers

2017-10-09 Thread Pierre-Marie de Rodat
This patch suppresses checks within finalizer routines, because they can't fail. No change in behavior; no test available. This is just an internal cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Bob Duff * exp_ch7.adb (Create_Finalizer):

[Ada] Premature evaluation of message string in Assert pragma

2017-10-14 Thread Pierre-Marie de Rodat
RM 11.4.2 stipulates that the optional string argument in an Assert pragma is evaluated only if the assertion fails and the string is incorporated into the raise statement. Previous to this patch the string expression was evaluated unconditionally, leading to unwanted side effects if its

[Ada] Repair ABI breakage on 32-bit x86/Linux

2017-10-14 Thread Pierre-Marie de Rodat
This repairs the ABI breakage for record types with Long_Float components introduced on 32-bit x86/Linux by the previous change. The Long_Float type is awkward on this platform because it has got a dual alignment setting: it's 8 for standalone object and array component and 4 for record

[Ada] Activation/suppression of SPARK elaboration rules

2017-10-14 Thread Pierre-Marie de Rodat
This patch utilizes compilation switch -gnatd.v to enforce the SPARK rules for elaboration in SPARK code. The affected scenarios are calls and instantiations. If the switch is active, the ABE mechanism will verify that the scenarios have fulfilled their Elaborate[_All] requirements. Otherwise the

[Ada] Calls in preelaborated units and pragma Remote_Call_Interface

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the check which ensures that no call is executed in a preelaborated unit. The check now properly ignores a case where a generic unit is subject to pragma Remote_Call_Interface, and the call appears in the body. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Missing warning about replacement of warnings off for unreferenced

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue introduced by Q220-025 where the use of pragma warnings off applied to an unreferenced variable is not warned about the possibility of replacing with the more specific pragma unreferenced when using the -gnatw.w. -- Source -- -- p.adb

[Ada] Proper resolution of Initializes and Initial_Condition

2017-10-14 Thread Pierre-Marie de Rodat
This patch modifies the processing of SPARK annotations Initializes and Initial_Condition to perform the resolution of the related expressions at the end of the enclosing package visible declarations. -- Source -- -- init_cond.ads package Init_Cond with SPARK_Mode,

[Ada] Remove obsolete comment for Generic_Parent

2017-10-14 Thread Pierre-Marie de Rodat
Routine [Set_]Generic_Parent can only be called on package, function and procedure specification nodes, as asserted in their bodies. It would crash when called for renaming or object declarations; the comment was most likely referring to some earlier implemenation idea. Tested on

[Ada] Variable assignments and reads in SPARK elaboration code

2017-10-14 Thread Pierre-Marie de Rodat
This patch reimplements the treatment of variable assignments and reads within SPARK elaboration code. The changes are as follows: 1) Diagnostics of variable assignments in elaboration code are now based on the rules in effect (either Ada or SPARK). 2) Variable assignments in Ada elaboration

[Ada] Missing validity check on record type component

2017-10-14 Thread Pierre-Marie de Rodat
The compiler may silently skip generating a validity check on a type conversion of a component of a record type. After this patch the error is reported on the following sources. pragma Initialize_Scalars; package Pkg is type T is record Major : Natural; Minor : Natural; end

[Ada] Spurious ineffective use_type_clause warning on private type

2017-10-14 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby a defaulted formal subprogram was not being accounted for when checking for ineffective use_type_clauses on private types used as generic actuals. -- Source -- -- types.ads package Types is type Enum_1 is private; private

[Ada] Fix performance regression of Ada.Numerics on 32-bit Windows

2017-10-14 Thread Pierre-Marie de Rodat
This fixes a run-time performance regression recently introduced on 32-bit Windows for Ada.Numerics by an unrelated change that exposed an old defect of the compiler on 32-bit Windows, namely that the Long_Long_Float type has got a wrong alignment of 8 instead of the expected 4. The following

Re: [PATCH v2] Python testcases to check DWARF output

2017-09-06 Thread Pierre-Marie de Rodat
. :-) -- Pierre-Marie de Rodat

[PATCH] [PR82155] Fix crash in dwarf2out_abstract_function

2017-09-12 Thread Pierre-Marie de Rodat
Hello, This patch is an attempt to fix the crash reported in PR82155. When generating a C++ class method for a class that is itself nested in a class method, dwarf2out_early_global_decl currently leaves the existing context DIE as it is if it already exists. However, it is possible that this

[Ada] Review dependency tracking for Ada sources without -gnatd.n support

2017-09-13 Thread Pierre-Marie de Rodat
support the -gnatd.n flag. Tested on x86_64-pc-linux-gnu, committed on trunk. 2017-09-13 Nicolas Roche <ro...@adacore.com> * Make-lang.in: In the fallback mechanim, parse the associated .ali file and try to guess the locations of dependencies. -- Pierre-Marie de Rodat Inde

[Ada] vxworks: auto-registration of foreign threads

2017-09-13 Thread Pierre-Marie de Rodat
To make Ada tasks and C threads interoperate better, we have added some functionality to Self. Suppose a C main program (with threads) calls an Ada procedure and the Ada procedure calls the tasking runtime system. Eventually, a call will be made to self. Since the call is not coming from an Ada

[Ada] Ineffective pragma Suppress (Alignment_Check) on warning

2017-09-13 Thread Pierre-Marie de Rodat
On platforms that require strict alignment of memory accesses, the per-object form of pragma Suppress (Alignment_Check) also disables the alignment warning associated with the check. That's not the case for the global form and this change fixes the inconsistency. Here's an example on a small

[Ada] Undefined symbol at link time due to Disable_Controlled

2017-09-13 Thread Pierre-Marie de Rodat
This patch reimplements aspect Disable_Controlled to plug the following holes in its original implementation: * The aspect may appear without an expression in which case the aspect defaults to True, however the compiler would crash due to the lack of expression. * If the

[Ada] Build in place for nonlimited types

2017-09-29 Thread Pierre-Marie de Rodat
First cut at build-in-place for nonlimited types. This is a work in progress; the build-in-place support is currently disabled. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-29 Bob Duff * exp_ch6.adb (Expand_Call_Helper): Handle case of build-in-place

[Ada] Avoid single colon in comment markup

2017-09-29 Thread Pierre-Marie de Rodat
This change allows our style-checker to implement a heuristic to detect either only typed one ':' or mistyped one of the characters, causing the entire markup block to disappear as it is then unexpectedly being treated as a comment instead. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Misleading warning when no read access for source file

2017-09-29 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby source files that did not have read permissions were incorrectly referred to as "not found'. Now, these different cases are explicitly identified and warned about properly. -- Source -- -- toto.c void toto(void) { } -- hello.adb

[Ada] Spurious error in nested generic containing expression function

2017-09-29 Thread Pierre-Marie de Rodat
This patch removes spurious visibility errors from the instantiation of a generic package nested within another generic, when the inner package contains an expression function that is the completion of a visible function of that package, and the expression includes an object of a tagged type local

[Ada] Compiler hangs on evaluation of use-clause within package context

2017-09-29 Thread Pierre-Marie de Rodat
Due to the installation order of packages within a context clause it is possible to create circularities within the Prev_Use_Clause clain. This patch corrects this issue by identifying this case through the use of an extra check. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-29

[Ada] Pragma Unchecked_Union on derived discriminated type

2017-09-29 Thread Pierre-Marie de Rodat
The compiler reports an spurious error processing a derived type of a non-tagged record type that has discriminants, pragma Unchecked_Union and pragma Convention C. After this patch the following test compiles silently. procedure Conversion is type small_array is array (0 .. 2) of Integer;

[Ada] Crash on illegal use of iterated component association

2017-09-29 Thread Pierre-Marie de Rodat
An iterated component association is an Ada2020 extension that simplifies the construction of array aggregates. This patch properly rejects the use of this construct as a named association in an aggregate for a record type. compiling gcc -c -gnat2020 klurigt-m2.adb must yield:

[Ada] Copy of Unchecked_Union derived discriminated types

2017-09-29 Thread Pierre-Marie de Rodat
The compiler crashes processing an assignment to a discriminated record type that has pragma Unchecked_Union and Convention C and is a derivation of a non-tagged record type with discriminants. After this patch the following test compiles silently. procedure Conversion is type small_array is

Re: [Ada] Use the Monotonic Clock on Linux

2017-09-26 Thread Pierre-Marie de Rodat
ch3 -- Pierre-Marie de Rodat

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Pierre-Marie de Rodat
that this instance of inlining is a win for both performance and code size, so it’s a good candidate even for -Os. Note that we inline string concatenation routines for the same reason. -- Pierre-Marie de Rodat

[Ada] Crash on classwide precondition for interface operation

2017-09-25 Thread Pierre-Marie de Rodat
This patch fixes a crash on a classwide precondition on an interface primitive with an controlling access parameter, when the precondition is a call that contains a reference to that formal. The following must execute quietly: gnatmake -q main main --- with Conditional_Interfaces; with

[Ada] Insert explicit dereference in GNATprove mode for pointer analysis

2017-09-25 Thread Pierre-Marie de Rodat
Safe pointer analysis in GNATprove mode depends on explicit dereferences being present in the tree. Insert them where needed on access to components in the special expansion performed in GNATprove mode. The following code is now analysed without errors in GNATprove mode (with -gnatd.F) with the

[Ada] Handle errors and limit simultaneous wait objects number in win32_wait

2017-09-25 Thread Pierre-Marie de Rodat
Everything is in the subject. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-25 Vasiliy Fofanov * adaint.c (win32_wait): Properly handle error and take into account the WIN32 limitation on the number of simultaneous wait objects. Index:

[Ada] Do not insert calls to invariant procedure in GNATprove mode

2017-09-25 Thread Pierre-Marie de Rodat
GNATprove handles specially invariant checks, and so does not expect to see calls to invariant procedures in the AST. This patch fixes the two places where such calls were inserted during semantic analysis, so that calls are only inserted when not in GNATprove mode. Possibly the same could be done

[Ada] Crash on an aspect specification with parameter associations

2017-09-25 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort in ASIS mode on an aspect specification whose expression is a function call with parameter associations. The following must compile quietly: gcc -c -gnatct p.adb --- with System; procedure P is type T is new Integer; package Obj is Buf : T := 1234;

[Ada] Use the Monotonic Clock on Linux

2017-09-25 Thread Pierre-Marie de Rodat
The monotonic clock epoch is set to some undetermined time in the past (typically system boot time). In order to use the monotonic clock for absolute time, the offset from a known epoch is calculated and incorporated into timed delay and sleep. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Improve performance of 'Image with enumeration types.

2017-09-25 Thread Pierre-Marie de Rodat
This patch improves the performance of the code generated by the compiler for attribute Image when applied to user-defined enumeration types and the sources are compiled with optimizations enabled. No test required. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-25 Javier Miranda

[Ada] Remove duplicated Has_Null_Abstract_State routines

2017-09-25 Thread Pierre-Marie de Rodat
Cleanup only; semantics unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-25 Piotr Trojanek * sem_util.adb (Has_Null_Abstract_State): Remove, as an exactly same routine is already provided by Einfo. * einfo.adb

[Ada] Entry family selector not recognised as entity usage

2017-09-25 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby index actuals in calls to entry families were not being properly flagged as referenced leading to spurious warnings when compiling with -gnatwu. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-09-25 Justin Squirek

[Ada] Spurious visibility error in ASIS mode

2017-09-25 Thread Pierre-Marie de Rodat
In ASIS mode we resolve the expressions in aspect specifications to provide sufficient semantic information, including entities and types of identifiers. The tree traversal that performs this resolution must omit identifiers that are selector names of parameter associations in calls, because these

[Ada] Proper qualification of concurrent discriminants

2017-09-25 Thread Pierre-Marie de Rodat
This patch modifies resolution to perform minor expansion for SPARK in order to properly qualify concurrent discriminants used as defaulted actuals in calls. -- Source -- -- p.ads package P is protected type PT (D : Integer) is procedure Dummy (Arg : Integer

[Ada] Minor clean up of contract freezing

2017-09-25 Thread Pierre-Marie de Rodat
This patch updates the analysis of Refined_State triggered by contract freezing to raise a more suitable exception when compilation has to be halted. -- Source -- -- pack.ads package Pack with Abstract_State => State is function F return Boolean with Global =>

[Ada] Crash on instantiation with renamed formal package.

2017-09-25 Thread Pierre-Marie de Rodat
This patch fixes a compiler abort on a package instantiation when the corresponding generic has a formal package, and the instantiation has an actual that renames the desired package instance. The following must compile quietly: gcc -c mc.adb --- package MC is procedure Dump_States; end

[Ada] Use of renamings in pragmas

2017-09-25 Thread Pierre-Marie de Rodat
This patch suppresses the transformation of references to renamings into references to renamed names when the reference appears within a pragma of no significance to SPARK. -- Source -- -- uname.adb procedure Uname is type Bounded_String is record Length :

[Ada] Default to no source locations in non-GCC backend bug boxes

2017-09-25 Thread Pierre-Marie de Rodat
Default to "No source file position information available" message for bug boxes emitted from the non-GCC backends. No test provided, because this only affects bug boxes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-25 Piotr Trojanek * adabkend.adb

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

2017-09-25 Thread Pierre-Marie de Rodat
On 09/25/2017 01:54 PM, Richard Biener wrote: Ok for trunk and gcc-7 branch after a while. Thank you, Richard! Committed on trunk as 253147; I’ll wait at least one week to revisit the gcc-7 branch commit. -- Pierre-Marie de Rodat

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-09-04 Thread Pierre-Marie de Rodat
. As discussed on IRC, I’m not very familiar with debug info generation for optimized code yet anyway. ;-) Are there still pending issues with this? Also, do you think we can port the fix for PR79542 on the 7 release branch? -- Pierre-Marie de Rodat

Re: [PATCH v2] Python testcases to check DWARF output

2017-09-04 Thread Pierre-Marie de Rodat
Hello, I would like to ping for the patch I submitted at <https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00653.html>. Thank you in advance! -- Pierre-Marie de Rodat

Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

2017-09-05 Thread Pierre-Marie de Rodat
On 09/04/2017 11:26 AM, Richard Biener wrote: No more pending issues and yes, I guess the fix is ok for the branch. Ok, thanks! This is now comitted on the 7 release branch. -- Pierre-Marie de Rodat

[Ada] Static allocation of secondary dispatch tables

2017-10-09 Thread Pierre-Marie de Rodat
This patch enhances the compiler to statically allocate secondary dispatch tables. No test available because it would require the analysis of the generated assembly code (thus depending on the target architecture). Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Javier Miranda

[Ada] Spurious error with expression function returning anonymous access

2017-10-09 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on an expression function that is a completion, when the expression is a function call that returns an anonymous access type. The preanalysis of the expression to freeze referenced types requires the proper computation of the access level of the function call, at

[Ada] Improve nnd debugging hooks

2017-10-09 Thread Pierre-Marie de Rodat
This patch improves and simplifies the debugging hooks. Now you just have to break on nnd to find all "interesting" creations/modifications of node ids. No change in functionality; no test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Bob Duff

[Ada] Spurious error with predicate and class-wide object

2017-10-09 Thread Pierre-Marie de Rodat
This patch removes a spurious error on a call to a function that applies to a predicated tagged type, when the actual in the call is class-wide. The argument must be converted to be type-specific, given that the predicate function is not dispatching and cannot accept a class-wide actual.

[Ada] Suppress generation of ABE checks in GNATprove mode

2017-10-09 Thread Pierre-Marie de Rodat
This patch suppresses the generation of ABE checks when compiling for GNATprove because a) the checks are not needed and b) the checks involve raise statements which are not supported by GNATprove. No need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Hristian

[Ada] Spurious error in use of homograph of type name in predicate

2017-10-09 Thread Pierre-Marie de Rodat
This patch fixes a spurious error in an expression for a dynamic predicate, when the name of (a homograph of) the type to which the predicate applies is used in a context where the name cannot denote a current occurrence. The following must compile quietly: gcc -c conv.ads --- with Typ; use

[Ada] Rewrite check for SPARK RM 7.1.3(10)

2017-10-09 Thread Pierre-Marie de Rodat
The evolution of SPARK RM 7.1.3(10) rule was not followed by code that implements it. The current wording is: "If a procedure has an in mode parameter of an effectively volatile type, then the Effective_Reads aspect of any corresponding actual parameter shall be False." and the

[Ada] Internal error on expression function in ghost package

2017-10-09 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby an expression function within a ghost package would cause orphaned freeze nodes. -- Source -- -- p.ads package P with SPARK_Mode is type Rec is record I : Integer; end record; package Inner with Ghost is

[Ada] Spurious warnings with dynamic elab checks

2017-10-09 Thread Pierre-Marie de Rodat
This patch classifies 'Access, variable assignments, and variable references as static model-only scenarios because they are graph-dependent and do not produce any checks. No need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Hristian Kirtchev

[Ada] Support for reverse iteration on formal containers

2017-10-09 Thread Pierre-Marie de Rodat
This patch adds support for reverse iterations over formal containers, analogous to what is supported on arrays and predefined containers. Executing: gnatmake -q foo foo must yield; 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 --- with Ada.Text_IO; use Ada.Text_IO;

[Ada] Check elaboration requirement for SPARK in the static model

2017-10-09 Thread Pierre-Marie de Rodat
This patch ensures that the Elaborate[_All] requirement imposed on the context of a unit in SPARK code is verified only when the static model is in effect. -- Source -- -- server.ads package Server with SPARK_Mode is function Read return Integer; end Server; --

[Ada] Crash on child unit name with -gnatdJ

2017-10-09 Thread Pierre-Marie de Rodat
When the debugging switch -gnatdJ is present, warning messages include the name of the unit within which the warning is generated. This patch fixes a crash in the compiler when a warning appears within a child unit. The command gcc -c -gnatdJ test-a.ads must yield; test-a.ads:6:17: warning:

[Ada] Crash on potential access-before-elaboration in ZFP

2017-10-09 Thread Pierre-Marie de Rodat
This patch update the mechanism which retrieves the enclosing scope of a node to account for blocks produces by exception handler expansion. These blocks are not scoping constructs and should not be considered. As a result, an access- before-elaboration check will no longer cause a crash on ZFP.

[Ada] Update the categorization of N_Call_Marker nodes

2017-10-09 Thread Pierre-Marie de Rodat
This patch update the categorization of node N_Call_Marker's fields. No change in behaviour, no need for a test. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-10-09 Hristian Kirtchev * sinfo.ads: Update table Is_Syntactic_Field to reflect the nature of

[Ada] Missing error on implicit copy of limited value in expression function

2017-10-09 Thread Pierre-Marie de Rodat
This patch corrects an omission on the legality check of an allocator whose expression is of a limited type, when the allocator is the expression of an expression function. Compiling t3.adb must yield: t3.adb:4:13: warning: not dispatching (must be defined in a package spec) t3.adb:5:07:

[Ada] Small optimizations in Sem_Type.Covers

2017-10-09 Thread Pierre-Marie de Rodat
The Sem_Type.Covers predicate is by far the topmost subprogram in the profile of unoptimized compilations in Ada. This change contains a series of small optimizations that save about 2% of the instruction count on x86-64: 1. Inline 3 more predicates from einfo, 2. Simplify a convoluted

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

[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

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

[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

[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

[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

[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

[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

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

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

[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

[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

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

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

[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

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

[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

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

[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

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

[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

[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

[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

[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

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