NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer
NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
-GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
+GNATLIBFLAGS = -W -Wall -gnatg -nostdinc
GNATLIBCFLAGS = -g -O2
# Pretend that _Unwind_GetIPInfo is available for the target by default. This
# should be autodetected during the configuration of libada and passed down to
pragma Provide_Shift_Operators (Val_2);
type Val is mod 2**Val_Bits with Alignment => Val_Bytes;
+ -- ??? It turns out that enabling checks on the instantiation of
+ -- System.Bitfield_Utils.G makes a latent visibility bug appear on strict
+ -- alignment platforms related to alignment checks. Work around it by
+ -- suppressing these checks explicitly.
+
+ pragma Suppress (Alignment_Check);
package Utils is new System.Bitfield_Utils.G (Val, Val_2);
procedure Copy_Bitfield
Get_Val_2 (S_Addr, S_Off, Initial_Size);
Initial_Val : constant Val :=
Get_Bitfield (Initial_Val_2, S_Off, Initial_Size);
+
begin
Set_Bitfield
(Initial_Val, D_Addr, D_Off, Initial_Size);
-- Start of processing for SS_Allocate
begin
- -- It should not be possible to request an allocation of negative or
- -- zero size.
-
- pragma Assert (Storage_Size > 0);
-
-- Round the requested size up to the nearest multiple of the maximum
-- alignment to ensure efficient access.
- Mem_Size := Round_Up (Storage_Size);
+ if Storage_Size = 0 then
+ Mem_Size := Memory_Alignment;
+ else
+ -- It should not be possible to request an allocation of negative
+ -- size.
+
+ pragma Assert (Storage_Size >= 0);
+ Mem_Size := Round_Up (Storage_Size);
+ end if;
if Sec_Stack_Dynamic then
Allocate_Dynamic (Stack, Mem_Size, Addr);