diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-10 23:27:23 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-10 23:27:23 +0200 |
commit | b1241d573822afcc591ba7a84b8866a440f24073 (patch) | |
tree | bbbe850229403dd418cb4b3cfaf1f18e7bb88882 /gcc | |
parent | a1b10eec36aa7aa32757fcdde3b53865d383399c (diff) | |
download | gcc-b1241d573822afcc591ba7a84b8866a440f24073.zip gcc-b1241d573822afcc591ba7a84b8866a440f24073.tar.gz gcc-b1241d573822afcc591ba7a84b8866a440f24073.tar.bz2 |
Do not use pragma Provide_Shift_Operators in Atree package
This pragma is relatively recent and may be problematic for the bootstrap.
gcc/ada/
* atree.ads (Slot): Remove pragma Provide_Shift_Operators.
(Shift_Left): New intrinsic function.
(Shift_Right): Likewise.
* atree.adb (Get_1_Bit_Val): Use Natural instead of Integer.
(Get_2_Bit_Val): Likewise.
(Get_4_Bit_Val): Likewise.
(Get_8_Bit_Val): Likewise.
(Set_1_Bit_Val): Likewise.
(Set_2_Bit_Val): Likewise.
(Set_4_Bit_Val): Likewise.
(Set_8_Bit_Val): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/atree.adb | 16 | ||||
-rw-r--r-- | gcc/ada/atree.ads | 7 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index f1969d2..4d4dc43 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -564,7 +564,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin return Field_1_Bit (Shift_Right (S, V) and 1); end Get_1_Bit_Val; @@ -577,7 +577,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin return Field_2_Bit (Shift_Right (S, V) and 3); end Get_2_Bit_Val; @@ -590,7 +590,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin return Field_4_Bit (Shift_Right (S, V) and 15); end Get_4_Bit_Val; @@ -603,7 +603,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin return Field_8_Bit (Shift_Right (S, V) and 255); end Get_8_Bit_Val; @@ -626,7 +626,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin S := (S and not Shift_Left (1, V)) or Shift_Left (Slot (Val), V); end Set_1_Bit_Val; @@ -639,7 +639,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin S := (S and not Shift_Left (3, V)) or Shift_Left (Slot (Val), V); end Set_2_Bit_Val; @@ -652,7 +652,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin S := (S and not Shift_Left (15, V)) or Shift_Left (Slot (Val), V); end Set_4_Bit_Val; @@ -665,7 +665,7 @@ package body Atree is pragma Debug (Validate_Node_And_Offset_Write (N, Offset / L)); S : Slot renames Slots.Table (Node_Offsets.Table (N) + Offset / L); - V : constant Integer := Integer ((Offset mod L) * (Slot_Size / L)); + V : constant Natural := Natural ((Offset mod L) * (Slot_Size / L)); begin S := (S and not Shift_Left (255, V)) or Shift_Left (Slot (Val), V); end Set_8_Bit_Val; diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index fa0c9c1..efb8ca2 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -653,7 +653,12 @@ package Atree is Slot_Size : constant := 32; type Slot is mod 2**Slot_Size; for Slot'Size use Slot_Size; - pragma Provide_Shift_Operators (Slot); + + function Shift_Left (S : Slot; V : Natural) return Slot; + pragma Import (Intrinsic, Shift_Left); + + function Shift_Right (S : Slot; V : Natural) return Slot; + pragma Import (Intrinsic, Shift_Right); type Field_1_Bit is mod 2**1; type Field_2_Bit is mod 2**2; |