diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-14 16:23:18 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-14 16:23:18 +0000 |
commit | ab2ba306f09948ff09fef49f3592d714c38b2d93 (patch) | |
tree | b12d13d305b3e049e0907c34ad5d505ce04fa415 /gcc/ada/s-taprop-posix.adb | |
parent | a39fe8c82fd895251538269b679047bd6fc98ac5 (diff) | |
download | gcc-ab2ba306f09948ff09fef49f3592d714c38b2d93.tar.gz |
2008-04-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r134275
stilly buggy for libgcc muldi3: internal compiler error: in
execute_ipa_pass_list, at passes.c:1235
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@134279 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-taprop-posix.adb')
-rw-r--r-- | gcc/ada/s-taprop-posix.adb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb index 816bb50a7b6..74ab07a0abb 100644 --- a/gcc/ada/s-taprop-posix.adb +++ b/gcc/ada/s-taprop-posix.adb @@ -73,6 +73,9 @@ package body System.Task_Primitives.Operations is use System.Parameters; use System.OS_Primitives; + Use_Alternate_Stack : constant Boolean := Alternate_Stack_Size /= 0; + -- Whether to use an alternate signal stack for stack overflows + ---------------- -- Local Data -- ---------------- @@ -268,10 +271,10 @@ package body System.Task_Primitives.Operations is --------------------- -- Note: mutexes and cond_variables needed per-task basis are - -- initialized in Intialize_TCB and the Storage_Error is + -- initialized in Initialize_TCB and the Storage_Error is -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...) -- used in RTS is initialized before any status change of RTS. - -- Therefore rasing Storage_Error in the following routines + -- Therefore raising Storage_Error in the following routines -- should be able to be handled safely. procedure Initialize_Lock @@ -798,6 +801,19 @@ package body System.Task_Primitives.Operations is end loop; Unlock_RTS; + + if Use_Alternate_Stack then + declare + Stack : aliased stack_t; + Result : Interfaces.C.int; + begin + Stack.ss_sp := Self_ID.Common.Task_Alternate_Stack; + Stack.ss_size := Alternate_Stack_Size; + Stack.ss_flags := 0; + Result := sigaltstack (Stack'Access, null); + pragma Assert (Result = 0); + end; + end if; end Enter_Task; -------------- @@ -932,7 +948,8 @@ package body System.Task_Primitives.Operations is use System.Task_Info; begin - Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size); + Adjusted_Stack_Size := + Interfaces.C.size_t (Stack_Size + Alternate_Stack_Size); if Stack_Base_Available then @@ -1415,6 +1432,11 @@ package body System.Task_Primitives.Operations is Specific.Initialize (Environment_Task); + if Use_Alternate_Stack then + Environment_Task.Common.Task_Alternate_Stack := + Alternate_Stack'Address; + end if; + Enter_Task (Environment_Task); -- Install the abort-signal handler |