[Ada] Implement tiered support for floating-point output operations

2021-05-05 Thread Pierre-Marie de Rodat
This changes the implementation of output operations for floating-point types from using Long_Long_Float for all floating-point types to using a base type tailored to the type being operated on. This comprises adjusting Ada.Text_IO.Float_IO and Ada.Text_IO.Complex_IO to the new approach, as well a

[Ada] Remove unnecessary parameter of Apply_Compile_Time_Constraint_Error

2021-05-05 Thread Pierre-Marie de Rodat
In routine Apply_Compile_Time_Constraint_Error the Rep parameter was disabling rewriting into N_Raise_Constraint_Error node. It is only referenced when this routine is called from GNATprove, but in GNATprove_Mode rewriting is disabled anyway. It seems cleaner to remove this parameter and keep this

[Ada] Refactor repeated call to Next when pretty-printing if-expressions

2021-05-05 Thread Pierre-Marie de Rodat
Code cleanup (and minuscule performance improvement); semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * pprint.adb (Expr_Name): Introduce local constants to make the code more readable and avoid repeated calls to Next to reach the ELSE

[Ada] Remove redundant explicit calls to UI_From_Int in comparisons

2021-05-05 Thread Pierre-Marie de Rodat
Relational operators for universal integers come in three variants, e.g.: function "=" (Left : Uint; Right : Uint) return Boolean renames UI_Eq; function "=" (Left : Int; Right : Uint) return Boolean renames UI_Eq; function "=" (Left : Uint; Right : Int) return Boolean renames UI_Eq; p

[Ada] Adjust expansion of perfect hash function for Value

2021-05-05 Thread Pierre-Marie de Rodat
This moves the declaration of the 4 tables to inside the function itself for reasons explained in the code. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_imgv.ads (Build_Enumeration_Image_Tables): Adjust comment. * exp_imgv.adb (Build_Enumeration_Image_Tables):

[Ada] Use inline expansion of Image for enumeration types by default

2021-05-05 Thread Pierre-Marie de Rodat
This reduces the number of bootstrap dependencies for the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d_x): Document new usage. * exp_imgv.adb (Expand_User_Defined_Enumeration_Image): Add Typ parameter and use it throughout the proces

[Ada] Handle defaults in declare_expressions in postconditions

2021-05-05 Thread Pierre-Marie de Rodat
In Ada2020 the expression for a postcondition can be a Declare_Expression containing object declarations with defaults. These defaults may generate local subtypes, but as for other default expressions their full expansion must be deferred, typically to the freeze point of the object being declared,

[Ada] Speed up enumeration'Value with perfect hash function

2021-05-05 Thread Pierre-Marie de Rodat
This speeds up the implementation of the Value attribute for enumeration types with more than 3 values by using a perfect hash function to do the lookup instead of a linear search. This also generizes the implementation of the associated support routines in the runtime, as well as that of the supp

[Ada] Don't emit style errors when parens are required

2021-05-05 Thread Pierre-Marie de Rodat
GNAT currently emits style errors for declare expressions in conditions even though their parens are required. This commit fixes that. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch5.adb (P_Condition): Check if expression is declare expression.diff --git a/gc

[Ada] Qualify internal access-to-subprogram types as not null

2021-05-05 Thread Pierre-Marie de Rodat
When an access-to-subprogram type is qualified as not null, then the compiler is likely to generate a more efficient code. This patch adds such qualifiers to the internal runtime bodies, so no clients of those runtime units are affected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Small cleanup in the Expand_Image_Attribute procedure

2021-05-05 Thread Pierre-Marie de Rodat
This moves the inline expansion for user-defined enumeration types back into the normal flow of control, moves the declarations of local objects to where they are needed and removes an explicit check for private types in the enumeration case, which is now superfluous. No functional changes. Teste

[Ada] Use inline expansion of Image for standard boolean by default

2021-05-05 Thread Pierre-Marie de Rodat
This avoids a call to the runtime and a string copy. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d_x): Document extended usage. * exp_imgv.adb (Expand_Standard_Boolean_Image): New procedure. (Expand_Image_Attribute): Call it to expand in line t

[Ada] Move Build_And_Insert_CUDA_Initialization to expansion phase

2021-05-05 Thread Pierre-Marie de Rodat
This function really had no business being called during analysis. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb (Expand_N_Package_Body): Add CUDA init call. * sem_ch7.adb (Analyze_Package_Body_Helper): Remove CUDA init call.diff --git a/gcc/ada

[Ada] Spurious warning on useless assignment with target name

2021-05-05 Thread Pierre-Marie de Rodat
An assignment to an entity E triggers an improper warning that an immediately preceding assignment to E is useless, when the right-hand side of the new assignment includes a target name, that is to say the Ada2020 use of "@" to designate the left-hand side of the assignment. Tested on x86_64-pc-li

[Ada] Detect unchecked union components with fully qualified names

2021-05-05 Thread Pierre-Marie de Rodat
Unchecked union components were detected only when declared with unqualified type names. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Component_Is_Unconstrained_UU): Detect both qualified and unqualified names of unchecked union components.diff --git

[Ada] Fix s-os_lib.adb so vectorizing compilation works

2021-05-05 Thread Pierre-Marie de Rodat
Fix s-os_lib.adb so vectorizing compilation works. Without this, the compiler crashes while compiling s-os_lib.adb. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-os_lib.adb (Missed_Drive_Letter): Simplify the code.diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/

[Ada] Remove redundant checks for empty lists

2021-05-05 Thread Pierre-Marie de Rodat
When iterating over list elements with First/Next there is no need to detect empty or non-existing list, because First intentionally returns Empty in those cases. Cleanup of code related to Unchecked_Unions; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Do not use hash function for enumeration Value with trampolines

2021-05-05 Thread Pierre-Marie de Rodat
This prevents the generation of the new perfect hash function for the Value attribute of local enumeration types when the target still uses trampolines to implement pointers to local subprograms. The generation of trampolines would be unexpected in these circumstances and maybe even forbidden by t

[Ada] Refine types of variables with call to Scope as their initial values

2021-05-05 Thread Pierre-Marie de Rodat
Call to Scope returns an Entity_Id, not just Node_Id. This patch refines the types in two occurrences of a call to Scope as an initial value. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (User_Defined_Primitive_Equality_

[Ada] Remove commented code

2021-05-05 Thread Pierre-Marie de Rodat
The comment indicates that "The whole section including this comment can be removed later ???", and 10 years qualifies as "later". Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Is_Possibly_Unaligned_Object): Remove commented code.diff --git a/gcc/ada/

[Ada] Incorrect accessibility level on actual in procedure call

2021-05-05 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby dispatching calls to subprograms featuring anonymous access formals may get incorrectly expanded in such a way so as to lead to spurious runtime accessibility check failures within the callee. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/

[Ada] Detect unchecked union subcomponents in nested variant parts

2021-05-05 Thread Pierre-Marie de Rodat
Routine Has_Unconstrained_UU_Component didn't traverse into nested variant parts of a record type definition. Now it precisely follows the Ada RM grammar to make sure that the traversal doesn't miss anything. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Has_U

[Ada] Fix expansion of attributes Input/Output for unchecked union types

2021-05-05 Thread Pierre-Marie de Rodat
Expansion of attributes Input/Output for unchecked unions didn't work, because it looked for a No_Elist where the AST has an empty list. Now we look for a default value of a first discriminant (because the default values must be given either for all or for none of the discrminants). Also, it was w

[Ada] Reuse Has_Defaulted_Discriminants where possible

2021-05-05 Thread Pierre-Marie de Rodat
Remove excessive defensive check from Has_Defaulted_Discriminants and reuse it where possible. Cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb, exp_ch9.adb, sem_ch3.adb: Reuse Has_Defaulted_Discriminants. *

[Ada] Remove redundant condition for Image attribute and Ada version

2021-05-06 Thread Pierre-Marie de Rodat
Routine Error_Msg_Ada_2012_Feature includes a test on Ada_Version, so there is no need to explicitly test the same condition just before the call. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Analyze_Image_Attribute): Remove redundant condition; add

[Ada] Remove excessive conditions in iterations across components

2021-05-06 Thread Pierre-Marie de Rodat
When iterating with First_Component/Next_Component we don't need to check that the Ekind of the iterator variable is E_Component. Code cleanup related to record equality and unchecked unions; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.a

[Ada] Crash on if_expression used as index of discriminant-dependent array

2021-05-06 Thread Pierre-Marie de Rodat
The compiler aborts on an if_expression used as an index when the object being indexed is a discriminant-dependent component, and the frontend generates an improper range check on the expression instead of the required index check. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Remove unused initial value in Read_Library_Info_From_Full

2021-05-06 Thread Pierre-Marie de Rodat
Remove an initial value of a local variable that were never used. Static analysis tools like CodePeer should easily recognize that this variable is only accessed after being written. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * osint.adb (Read_Library_Info_From_Full): Cle

[Ada] Fix restriction No_Enumeration_Maps on both Image attributes

2021-05-06 Thread Pierre-Marie de Rodat
Restriction No_Enumeration_Maps was only checked on Value attribute (and its Wide and Wide_Wide variants). Now it is checked also on Img, Image and its Wide and Wide_Wide variants, just like described in the GNAT RM. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.a

[Ada] Implement tiered support for floating-point exponentiation

2021-05-06 Thread Pierre-Marie de Rodat
This changes the implementation of floating-point exponentiation from using Long_Long_Float for all floating-point types to using a base type tailored to the type being operated on. The computation is done in double precision internally, which gives more accurate results for Long_Float and Long_Lo

[Ada] Remove hardcoded pragma Warnings from the formal vectors library

2021-05-06 Thread Pierre-Marie de Rodat
Pragma Warnings in the generic formal vectors library was only suppressing a message in one specific instantiation within one specific GNATprove test. This pragma was referring to "type T defined at line 4", which is exactly the type declared in that test; the suppression didn't work for any other

[Ada] Fix handling of PATs

2021-05-06 Thread Pierre-Marie de Rodat
When trying to compare two fields, one that's a packed array of known length and one that's a packed array of unknown length, Expand_Packed_Eq converts each side of the equality to its packed array type and then says that's enough if the types are modular integer types. That's correct, however, onl

[Ada] Make new implementation of System.Fat_Gen.Valid more robust

2021-05-06 Thread Pierre-Marie de Rodat
The comparison of any denormalized number with 0.0 may return True on hardware not supporting denormals, so we need to do a bit comparison. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-fatgen.adb (Valid): Do a bit comparison with 0.0 when denormalized nu

[Ada] Spurious constraint error on conversion of access types

2021-05-06 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby a spurious constraint error is raised at runtime on type conversions between access-to-discriminanted types when the object being converted is null. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb (Make_Discriminan

[Ada] Fix off-by-one bug in underflow handling of Scaling

2021-05-06 Thread Pierre-Marie de Rodat
Gradual underflow needs to be used for one more exponent. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-fatgen.adb (Scaling): Fix off-by-one bug for underflow.diff --git a/gcc/ada/libgnat/s-fatgen.adb b/gcc/ada/libgnat/s-fatgen.adb --- a/gcc/ada/libgnat/s-fatgen.

[Ada] Reset x87 FPU to 64-bit precision for floating-point I/O on Linux

2021-05-06 Thread Pierre-Marie de Rodat
This is basically done on all x86/x86-64 native systems except for Linux and makes it possible to work around other precision settings, e.g Java's. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * init.c (__gnat_init_float): Use full version on Linux too.diff --git a/gcc/ada/

[Ada] Make Is_OK_Static_Subtype use Is_Static_Subtype

2021-05-06 Thread Pierre-Marie de Rodat
The reason for this change is two-fold: - There is code duplication between Is_OK_Static_Subtype and Is_Static_Subtype - Is_Static_Subtype is more correct than Is_OK_Static_Subtype (e.g. the dynamic predicate checks are more complete in Is_Static_Subtype). Tested on x86_64-pc-linux-gnu, commit

[Ada] Set Raises_CE flag only in Apply_Compile_Time_Constraint_Error

2021-05-06 Thread Pierre-Marie de Rodat
Routine Apply_Compile_Time_Constraint_Error, when operating in GNAT mode, always sets Raises_Constraint_Error flag, so there is no need to follow it with calls to Set_Raises_Constraint_Error. These calls only had an effect in GNATprove mode, but they were following few calls to Apply_Compile_Time_C

[Ada] Do not second-guess the hardware for underflow handling of Scaling

2021-05-06 Thread Pierre-Marie de Rodat
This defers to the hardware implementation for the handling of underflow in the Scaling routine also in the case where denormals are not supported. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-fatgen.adb (Scaling): Use single handling of underflow. Add

[Ada] Assert failure on pragma Inline in procedure body

2021-05-06 Thread Pierre-Marie de Rodat
Is_Inline_Pragma isn't always dealing properly with N not being a list member and Spec_Id being null. This is now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Is_Inline_Pragma): Protect against N not being a list member in both branches.diff --

[Ada] Missing semantic error on ineffective Others_Clause

2021-05-06 Thread Pierre-Marie de Rodat
Compiler fails to reject an Others_Clause in an aggregate for a constrained array type when previous components of the aggregate cover the full index range of the array subtype, and the expression in the Others_Clause has a type incompatible with the component type of the array. The Others_Clause d

[Ada] In CodePeer mode, use regular-exception handling

2021-05-06 Thread Pierre-Marie de Rodat
After a change done for GNATProve in 2016, CodePeer_Mode was not using the regular exception mechanism. This resulted in imprecise control-flow graphs in some cases. Revert that change for CodePeer. And, since for GNATprove_Mode Operating_Mode is never Generate_Code, we can simplify the code a bit.

[Ada] AI12-0411: Add "bool" to Interfaces.C

2021-05-06 Thread Pierre-Marie de Rodat
This AI adds in Interfaces.C a binding to the C type _Bool/bool. Note that this AI makes ambiguous the construct pragma Assert (False) when using Interfaces.C. To hopefully provide slightly better backward compatibility, we make Interfaces.C.Extensions.bool a renaming of Interfaces.C.bool so that

[Ada] Bad expansion with -gnato2 and if expression

2021-05-06 Thread Pierre-Marie de Rodat
When dealing with -gnato2 inside an if expression, we might drop on the floor the If or Else_Nodes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_If_Expression): Apply_Arithmetic_Overflow_Check will not deal with Then/Else_Actions so s

[Ada] Avoid repeated analysis of constraint ranges

2021-05-06 Thread Pierre-Marie de Rodat
Don't call Analyse just before Process_Range_Expr_In_Decl, because the latter starts with a call to Analyze_And_Resolve anyway. This fixes a violation with the required sequencing in resolution of overloaded nodes that requires the Etype being Any_Type and Is_Overloading being False before calling

[Ada] ACATS 4.1R-c611a04: Class-wide preconditions in dispatching calls

2021-05-06 Thread Pierre-Marie de Rodat
This patch is a partial implementation of the semantics mandated in AI12-0195 concerning class-wide preconditions on dispatching calls: the precondition that applies is that of the denoted subprogram entity, not that of the body that is actually executed. Tested on x86_64-pc-linux-gnu, committed o

[Ada] Spurious error on protected call in inherited postcondition

2021-05-07 Thread Pierre-Marie de Rodat
An inherited class-wide precondition of a primitive of a protected type cannot include a call to a protected primitive of the type, as specified in AI12-0166. This patch adds a guard to verify that this legality rule applies only to a precondition and not to a postcondition. Tested on x86_64-pc-l

[Ada] Move Has_Inferable_Discriminants to Sem_Util

2021-05-07 Thread Pierre-Marie de Rodat
Move the Has_Inferable_Discriminants utility to Sem_Util so that it can be reused inside GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Has_Inferable_Discriminants): Moved to Sem_Util. * sem_util.ads, sem_util.adb (Has_Inferable_Discriminants

[Ada] Raise Constraint_Error for Compose and Scaling if Machine_Overflows

2021-05-07 Thread Pierre-Marie de Rodat
This is an optional behavior specified by the RM and it makes sense to do it when T'Machine_Overflows is True for the sake of consistency. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-fatgen.adb (Scaling): Raise Constraint_Error in the overflow case when

[Ada] sigtramp: fix powerpc64 against -fPIC

2021-05-07 Thread Pierre-Marie de Rodat
Use a local label to set the TOC location on powerpc64 to prevent DT_TEXTREL, not supported by the VxWorks loader for shared libraries. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sigtramp-vxworks-target.inc: Use a local label for the TOC.diff --git a/gcc/ada/sigtramp-vx

[Ada] Minor efficiency improvement in containers

2021-05-07 Thread Pierre-Marie de Rodat
Move an assertion to be conditional on T_Check, so pragma Suppress (Tampering_Checks) will suppress it. Note that the Lock component being checked has the Atomic aspect. This is not a bug fix. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-conhel.adb (TC_Check):

[Ada] Fix signature mismatch for Defining_Entity

2021-05-07 Thread Pierre-Marie de Rodat
This fixes the signature mismatch recently introduced for Defining_Entity between the front-end proper and gigi. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads (Defining_Entity): Remove Empty_On_Errors parameter. (Defining_Entity_Or_Empty): New function

[Ada] Computation of Shift_Left and large signed values

2021-05-07 Thread Pierre-Marie de Rodat
The computation of Shift_Left on signed values might wrongly overflow instead of generating a negative value. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_eval.adb (Fold_Shift): Fix computation of Shift_Left resulting in negative signed values.diff --git a/gcc

[Ada] Crash on imported object with deep initialization and No_Aborts

2021-05-07 Thread Pierre-Marie de Rodat
Compiler aborts on an object declaration without an expression, when the type of the object includes controlled components and thus requires deep initialization, there are various restrictions in effect that prevent Abort statements, and there is a later Import pragma that applies to the object bei

[Ada] Attribute Address is not an interfering context in SPARK

2021-05-07 Thread Pierre-Marie de Rodat
Allow taking the address of a volatile object in SPARK, as it doesn't cause problems related to interfering contexts. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Flag_Object): Ignore prefixes of attribute Address.diff --git a/gcc/ada/sem_res.adb b/gc

[Ada] Remove End_Interp_List from the overloaded resolution API

2021-05-07 Thread Pierre-Marie de Rodat
Routine End_Interp_List was part of the API for overloaded resolution from the very beginning. However, it quickly become unnecessary, because both adding and removing interpretation maintains a No_Interp marker at the end of the interpretation list. The only effect of this routine was that it pre

[Ada] Generate warning for negative literal of a modular type

2021-05-07 Thread Pierre-Marie de Rodat
A negative literal of a module type is interpreted with wrap-around as a large positive number. Warn if this value is not enclosed in a type qualification or type conversion explicitly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * opt.ads: Update comment for Warn_On_Suspi

[Ada] Spurious error with component of unchecked_union type

2021-05-07 Thread Pierre-Marie de Rodat
Compiler rejects an equality operation on a record type when the nominal subtype of a component is a constrained subtype of an Unchecked_Union type, and that subtype is declared outside of the enclosing record declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_

[Ada] Fix type mismatch warnings during LTO bootstrap #1

2021-05-07 Thread Pierre-Marie de Rodat
This sets convention C on enumeration types and functions declarations involving System.Address, and makes adjustements to fe.h accordingly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.ads (Set_Identifier_Casing): Add pragma Convention C. * eval_fat.ads (R

[Ada] Implement aspect No_Controlled_Parts

2021-05-07 Thread Pierre-Marie de Rodat
This patch implements the No_Controlled_Parts aspect defined in AI12-0256 which when specified for a type will verify such type or any ancestors of such type with contain no controlled components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * aspects.ads: Add entries to re

[Ada] Small cleanup in C header file

2021-05-07 Thread Pierre-Marie de Rodat
This fixes a few deviations from the GCC Coding Conventions, differences between declarations and definitions of functions and minor other things. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.h (Parent): Remove duplicate declaration. (Get_1_Bit_Field): Also

[Ada] Fix type mismatch warnings during LTO bootstrap #2

2021-05-07 Thread Pierre-Marie de Rodat
This fixes the type of parameters and variables in the C code, changes the convention of Raise_From_Signal_Handler to C and uses a compatible boolean type for Is_Handled_By_Others. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * init.c (__gnat_raise_program_error): Fix param

[Ada] Fix type mismatch warnings during LTO bootstrap #5

2021-05-07 Thread Pierre-Marie de Rodat
This changes the C interface to Ada.Exceptions.Exception_Propagation from using the opaque _Unwind_Ptr to using the explicit Exception_Id, which is the C view of the Exception_Data_Ptr declared in System.Standard_Library. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * raise

[Ada] Fix type mismatch warnings during LTO bootstrap #3

2021-05-07 Thread Pierre-Marie de Rodat
This changes a type name to avoid a violation of the C++ ODR with LTO, sets convention C on another enumeration type and declares a matching enumeration type in C, fixes a blatant type mismatch, marks components as aliased in a couple of record types and tweaks one of them a bit more. Tested on x8

[Ada] Replace packed records with integers in low-level implementation

2021-05-07 Thread Pierre-Marie de Rodat
Accessing components in packed record types turns out to be too slow for practical use so this replaces them with integer types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.ads (Slot): Change to modular type. (Slot_1_Bit): Delete. (Slot_2_Bit): Like

[Ada] Variable-sized node types -- cleanup

2021-05-07 Thread Pierre-Marie de Rodat
Fix incorrect comments. Clean up marks. Rename Set_Ekind to be Mutate_Ekind to match Mutate_Nkind. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.ads, atree.adb, gen_il-gen.ads: Fix comments and clean up ??? marks. Rename Set_Ekind to be Mutate_Ekind.

[Ada] Fix link from body protected entry implementation to source code

2021-05-07 Thread Pierre-Marie de Rodat
CodePeer needs to recognize internally generated procedures that implement protected entries. Previously this was done with an extra field in the procedure entity; now it is done with an extra field in the procedure body. The new field bypasses the trouble with the procedure entity changing its ty

[Ada] Fix type mismatch warnings during LTO bootstrap #4

2021-05-07 Thread Pierre-Marie de Rodat
There are 3 views of the exception record type in an Ada program: the master is declared as Exception_Data in System.Standard_Library, the compiler view is built by Cstand at the beginning of the compilation, and the C view is declared in the raise.h header file. These views must be sufficiently a

[Ada] Reinitialize Private_Dependents when it is vanishing

2021-05-07 Thread Pierre-Marie de Rodat
We call Set_Ekind on a E_Incomplete_Subtype entity, and the Private_Dependents field vanishes. This patch resets it to zero, as required for vanishing fields. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Process_Incomplete_Dependents): Reset Private_D

[Ada] Robust detection of access-to-subprogram and access-to-object types

2021-05-07 Thread Pierre-Marie de Rodat
Routines Is_Access_Object_Type and Is_Access_Subprogram_Type were arbitrarily categorizing E_Access_Subtype as an access-to-object, even though it could represent an access-to-subprogram. Now those routines examine not just the Ekind, but also the Designated_Type of an access (sub)type, which is m

[Ada] Restore nnd capability

2021-05-07 Thread Pierre-Marie de Rodat
Move the nnd capability from Atree to Sinfo.Utils, because Atree is now compiled with "pragma Assertion_Policy (Ignore);", which disables pragma Debug. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.adb: Move nnd-related code from here, and leave a comment poi

Re: [PATCH] DWARF: add abstract origin links on lexical blocks DIEs

2016-01-20 Thread Pierre-Marie de Rodat
On 01/18/2016 10:47 AM, Pierre-Marie de Rodat wrote: Thank you for your inputs! I’m going to try that, then. I hope this test will not be too fragile… Here it is! Re-bootstrapped and regtested successfuly on x86_64-linux. I’ve checked that the testcase fails on the mainline. -- Pierre-Marie

Re: [PATCH 10/9] ENABLE_CHECKING refactoring: remove remaining occurrences

2016-02-24 Thread Pierre-Marie de Rodat
want. I’m a little bit desynchronized with the development pace these days: would this be for stage 4 or GCC 7? -- Pierre-Marie de Rodat

Re: [PATCH 10/9] ENABLE_CHECKING refactoring: remove remaining occurrences

2016-02-25 Thread Pierre-Marie de Rodat
d you do the substitution ENABLE_CHECKING → CHECKING_P for these dwarf2out.* occurences as part of it? -- Pierre-Marie de Rodat

Re: [PATCH 10/9] ENABLE_CHECKING refactoring: remove remaining occurrences

2016-02-25 Thread Pierre-Marie de Rodat
On 02/25/2016 11:15 AM, Martin Liška wrote: Sure. Just working on that. Great, thank you! -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2016-02-25 Thread Pierre-Marie de Rodat
other thread (https://gcc.gnu.org/ml/gcc-patches/2016-01/msg01078.html), I always feel uncomfortable writing brittle dg-scan testcases, hence the current lack of testcases for those DWARF changes. -- Pierre-Marie de Rodat

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2016-02-25 Thread Pierre-Marie de Rodat
just that prune_unused_types_walk_loc_descr does not know about this kind of operation. I think the attached patch is a more general fix for that. What do you think? (bootstrapped and regtested on x86_64-linux) -- Pierre-Marie de Rodat >From 671199e8a7da326e54e081b5c368f93428455e98 Mon Sep 17 00:00

Re: [PATCHES, PING*5] Enhance standard DWARF for Ada

2016-02-25 Thread Pierre-Marie de Rodat
-S -g -fgnat-encodings=minimal -dA foo.adb && grep DW_OP_call4 foo.s foo.s:313: .byte 0x99# DW_OP_call4 -- Pierre-Marie de Rodat procedure Foo is type Record_Type (N : Natural) is record S1 : String (1 .. N); S2 : String (1 .. N); end record; procedure Pr

Re: [PATCH] Fix DW_OP_GNU_implicit_pointer referring to DW_TAG_dwarf_procedure (PR debug/69947)

2016-02-26 Thread Pierre-Marie de Rodat
hanks! -- Pierre-Marie de Rodat

[PATCHES] Enhance standard DWARF for Ada

2015-07-16 Thread Pierre-Marie de Rodat
Ok for trunk? Thank you in advance for the review! [1] https://github.com/eliben/pyelftools/ -- Pierre-Marie de Rodat

[PATCH 1/8] Add a flag to control the balance between GNAT encodings, and std. DWARF

2015-07-16 Thread Pierre-Marie de Rodat
eclare a global variable. (gnat_post_options): Initialize this global from options. -- Pierre-Marie de Rodat >From 77212283fa0ddbbf6aef4a6f16aa0e8286b811f3 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 17 Sep 2014 14:54:50 +0200 Subject: [PATCH 1/8] Add a flag to control t

[PATCH 2/8] DWARF: handle variable-length records and variant parts

2015-07-16 Thread Pierre-Marie de Rodat
c. descr. lists. (prune_unused_types_walk): Don't mark DWARF procedures by default. Mark variant parts since nothing is supposed to reference them. gcc/testsuite/ChangeLog: * gnat.dg/specs/debug1.ads: Update the expected number of DW_AT_artificial attribute in compiler output.

[PATCH 3/8] DWARF: add a language hook to override types in debugging information

2015-07-16 Thread Pierre-Marie de Rodat
2out.c (modified_type_die): Invoke the get_debug_type language hook, process its result instead, if any. (gen_descr_array_type_die): Add array-wide stride processing. -- Pierre-Marie de Rodat >From d50a4b3d02753ccd89e05d08d9f7a9516afdf8de Mon Sep 17 00:00:00 2001 From: Pierre-Marie de R

[PATCH 4/8] DWARF: add a language hook for fixed-point types

2015-07-16 Thread Pierre-Marie de Rodat
. * dwarf2out.h (enum fixed_point_scale_factor): New. (struct fixed_point_type_info): New. * dwarf2out.c (base_type_die): In DWARFv3 or non-strict DWARF mode, get fixed-point type information using the debugging hook and describe it in DWARF, if any. -- Pierre-Marie de Rodat

[PATCH 5/8] DWARF: describe Ada dynamic arrays as proper arrays

2015-07-16 Thread Pierre-Marie de Rodat
pointers and generate the corresponding array type descriptions. -- Pierre-Marie de Rodat >From 27e94b46e4873b175682848e87ccc60bec9f98b2 Mon Sep 17 00:00:00 2001 From: derodat Date: Fri, 3 Oct 2014 09:57:06 + Subject: [PATCH 5/8] DWARF: describe Ada dynamic arrays as proper arrays

[PATCH 6/8] create a macro for max dimensions for array descr. lang. hook

2015-07-16 Thread Pierre-Marie de Rodat
size. * dwarf2out.c (gen_type_die_with_usage): Check that the array descr. language hook does not return an array with more dimensions that it should. -- Pierre-Marie de Rodat >From 5221a4fadfa84f31cc97e0eba26f8640c9abe70d Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Fri

[PATCH 7/8] DWARF: add a language hook for scalar biased types

2015-07-16 Thread Pierre-Marie de Rodat
the bias to subrange_type_die. -- Pierre-Marie de Rodat >From 702af856454dd74dc23979e488d311ea008981ee Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Thu, 8 Jan 2015 11:07:06 +0100 Subject: [PATCH 7/8] DWARF: add a language hook for scalar biased types Front-ends like GNAT

[PATCH 8/8] DWARF: describe properly Ada packed arrays

2015-07-16 Thread Pierre-Marie de Rodat
ne of the original packed type, if any. Fix TYPE_DECL peeling around the name of the input type. -- Pierre-Marie de Rodat >From 2be4df85e18e86c999d7f493366804bb57052abf Mon Sep 17 00:00:00 2001 From: derodat Date: Thu, 18 Dec 2014 12:45:52 + Subject: [PATCH 8/8] DWARF: describe

Re: [PATCH 2/8] DWARF: handle variable-length records and variant parts

2015-07-16 Thread Pierre-Marie de Rodat
ificial attribute in compiler output. -- Pierre-Marie de Rodat >From a7ba9b22e494c0d7db0d141008f87c33fd7864a3 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Thu, 3 Jul 2014 14:16:09 +0200 Subject: [PATCH 2/8] DWARF: handle variable-length records and variant parts Enhance the DWARF

Re: [PATCH 1/8] Add a flag to control the balance between GNAT encodings, and std. DWARF

2015-07-16 Thread Pierre-Marie de Rodat
On 07/16/2015 12:12 PM, Richard Biener wrote: On Thu, Jul 16, 2015 at 10:52 AM, Andreas Schwab wrote: Pierre-Marie de Rodat writes: +fgnat-encodings= IMHO the option name should include "dwarf". And start with -g Thank you for your answers! Changing the name of the opti

[PATCH] PR rtl-optimization/66790: uninitialized registers handling in REE

2015-07-18 Thread Pierre-Marie de Rodat
registers using the MIR dataflow problem. Update the call to add_removable_extension. (find_and_remove_re): Call df_mir_add_problem. -- Pierre-Marie de Rodat >From 2b0fe78644c3c3b16555b69d0b787dbad4a434a4 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date

[PATCH] PR debug/53927: fix value for DW_AT_static_link

2015-07-20 Thread Pierre-Marie de Rodat
sted.c (finalize_nesting_tree_1): Append a field to hold the frame base address. * dwarf2out.c (gen_subprogram_die): Generate for DW_AT_static_link a location description that computes the value of this field. -- Pierre-Marie de Rodat

[PATCH] Track indirect calls for call site information in debug info.

2015-07-20 Thread Pierre-Marie de Rodat
-- Pierre-Marie de Rodat >From 1fee786f51baca25f1363cd82f207cd67f48e69f Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Thu, 13 Jun 2013 11:13:08 +0200 Subject: [PATCH] Track indirect calls for call site information in debug info. gcc/ChangeLog: * passes.def: A

[PATCHES, PING] Enhance standard DWARF for Ada

2015-07-23 Thread Pierre-Marie de Rodat
On 07/16/2015 10:34 AM, Pierre-Marie de Rodat wrote: This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, variable-length records, variant parts, etc. Ping for the pa

[PATCH] DWARF: materialize subprogram renamings in Ada as imported declarations

2015-07-25 Thread Pierre-Marie de Rodat
atch for it). Ok for trunk? Thank you in advance for your feedback! -- Pierre-Marie de Rodat >From 8eed7558683e817755314d00adaf9b4820742d22 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 22 Jul 2015 19:41:08 +0200 Subject: [PATCH] DWARF: materialize subprogram renam

[PATCH, PING] PR rtl-optimization/66790: uninitialized registers handling in REE

2015-07-27 Thread Pierre-Marie de Rodat
On 07/19/2015 12:14 AM, Pierre-Marie de Rodat wrote: This patch is an attempt to fix PR rtl-optimization/66790: please see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790> for the context. This adds a new dataflow problem (MIR for Must-Initialized Registers) and use it in the REE p

[PATCH, PING] PR debug/53927: fix value for DW_AT_static_link

2015-07-27 Thread Pierre-Marie de Rodat
On 07/20/2015 09:39 AM, Pierre-Marie de Rodat wrote: This patch fixes the static link description in DWARF to comply with the specification. In order to do so, it appends a field to all FRAME objects to hold the frame base address (DW_AT_frame_base) so that the nested subrograms can directly

[PATCH, PING] Track indirect calls for call site information in debug info.

2015-07-27 Thread Pierre-Marie de Rodat
On 07/20/2015 02:45 PM, Pierre-Marie de Rodat wrote: On PowerPC targets with -mlongcall, most subprogram calls are turned into indirect calls: the call target is read from a register even though it is compile-time known. This makes it difficult for machine code static analysis engines to recover

[PATCHES, PING*2] Enhance standard DWARF for Ada

2015-07-31 Thread Pierre-Marie de Rodat
On 07/16/2015 10:34 AM, Pierre-Marie de Rodat wrote: This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, variable-length records, variant parts, etc. Ping for the pa

Re: [PATCHES, PING*2] Enhance standard DWARF for Ada

2015-07-31 Thread Pierre-Marie de Rodat
On 07/31/2015 12:54 PM, Pierre-Marie de Rodat wrote: On 07/16/2015 10:34 AM, Pierre-Marie de Rodat wrote: This patch series aims at enhancing GCC to emit standard DWARF in place of the current GNAT encodings (non-standard DWARF) for a set of "basic" types: dynamic arrays, varia

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