diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-25 10:37:09 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-25 10:37:09 +0200 |
commit | b619c88ebaa63de53de21684bdd4555598f68d49 (patch) | |
tree | ab0026650c67902552f38fd6ccaae3889a755f1d /gcc/ada/a-tasatt.adb | |
parent | 2bb988bb1cb15663ce9d01368d31d66161183b41 (diff) | |
download | gcc-b619c88ebaa63de53de21684bdd4555598f68d49.zip gcc-b619c88ebaa63de53de21684bdd4555598f68d49.tar.gz gcc-b619c88ebaa63de53de21684bdd4555598f68d49.tar.bz2 |
[multiple changes]
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
* elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
* exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
the purposes of freezing.
* exp_util.adb Update the documentation and structure of the
type map used in class-wide semantics of assertion expressions.
(Add_Inherited_Tagged_DIC): There is really no need to preanalyze
and resolve the triaged expression because all substitutions
refer to the proper entities. Update the replacement of
references.
(Build_DIC_Procedure_Body): Add formal parameter
For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
are now only processed when freezing occurs. Build a body only
when one is needed.
(Entity_Hash): Removed.
(Map_Types): New routine.
(Replace_Object_And_Primitive_References): Removed.
(Replace_References): New routine.
(Replace_Type_References): Moved to the library level of Exp_Util.
(Type_Map_Hash): New routine.
(Update_Primitives_Mapping): Update the mapping call.
(Update_Primitives_Mapping_Of_Types): Removed.
* exp_util.ads (Build_DIC_Procedure_Body): Add formal
parameter For_Freeze and update the comment on usage.
(Map_Types): New routine.
(Replace_References): New routine.
(Replace_Type_References): Moved to the library level of Exp_Util.
(Update_Primitives_Mapping_Of_Types): Removed.
* sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
properties of the private type to the full view in case the full
view derives from a parent type and inherits a DIC pragma.
* sem_prag.adb (Analyze_Pragma): Guard against a case where a
DIC pragma is placed at the top of a declarative region.
2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek>
* a-tasatt.adb: Complete previous change and use an unsigned
int to avoid overflow checks.
2017-04-25 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
the error message when the attribute reference is an actual in
a call to a subprogram inherited from a generic formal type with
unknown discriminants, which makes the subprogram and its formal
parameters intrinsic (see RM 6.3.1 (8) and (13)).
From-SVN: r247148
Diffstat (limited to 'gcc/ada/a-tasatt.adb')
-rw-r--r-- | gcc/ada/a-tasatt.adb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/ada/a-tasatt.adb b/gcc/ada/a-tasatt.adb index 703d140..97cc06e 100644 --- a/gcc/ada/a-tasatt.adb +++ b/gcc/ada/a-tasatt.adb @@ -93,10 +93,11 @@ package body Ada.Task_Attributes is function To_Attribute is new Ada.Unchecked_Conversion (Atomic_Address, Attribute); + type Unsigned is mod 2 ** Integer'Size; function To_Address is new Ada.Unchecked_Conversion (Attribute, System.Address); - function To_Int is new - Ada.Unchecked_Conversion (Attribute, Integer); + function To_Unsigned is new + Ada.Unchecked_Conversion (Attribute, Unsigned); pragma Warnings (On); @@ -121,7 +122,7 @@ package body Ada.Task_Attributes is Fast_Path : constant Boolean := (Attribute'Size = Integer'Size and then Attribute'Alignment <= Atomic_Address'Alignment - and then To_Int (Initial_Value) = 0) + and then To_Unsigned (Initial_Value) = 0) or else (Attribute'Size = System.Address'Size and then Attribute'Alignment <= Atomic_Address'Alignment and then To_Address (Initial_Value) = System.Null_Address); @@ -303,7 +304,7 @@ package body Ada.Task_Attributes is -- No finalization needed, simply set to Val if Attribute'Size = Integer'Size then - TT.Attributes (Index) := Atomic_Address (To_Int (Val)); + TT.Attributes (Index) := Atomic_Address (To_Unsigned (Val)); else TT.Attributes (Index) := To_Address (Val); end if; |