public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Constraint_Error in Task_Wrapper and -u0
@ 2020-11-26  8:41 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-11-26  8:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arnaud Charlet

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

When using the gnatbind switch -u0 and a runtime built with checks on,
we could get a range check error in System.Tasking.Stages.Task_Wrapper,
now fixed.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* libgnarl/s-tassta.adb (Task_Wrapper): Fix computation of
	Pattern_Size.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1464 bytes --]

diff --git a/gcc/ada/libgnarl/s-tassta.adb b/gcc/ada/libgnarl/s-tassta.adb
--- a/gcc/ada/libgnarl/s-tassta.adb
+++ b/gcc/ada/libgnarl/s-tassta.adb
@@ -1096,11 +1096,10 @@ package body System.Tasking.Stages is
             --  stack analysis.
 
             Big_Overflow_Guard : constant := 64 * 1024 + 8 * 1024;
-            Small_Stack_Limit  : constant := 64 * 1024;
-            --  ??? These three values are experimental, and seem to work on
-            --  most platforms. They still need to be analyzed further. They
-            --  also need documentation, what are they and why does the logic
-            --  differ depending on whether the stack is large or small???
+            --  These two values are experimental, and seem to work on most
+            --  platforms. They still need to be analyzed further. They also
+            --  need documentation, what are they and why does the logic differ
+            --  depending on whether the stack is large or small???
 
             Pattern_Size : Natural :=
                              Natural (Self_ID.Common.
@@ -1123,7 +1122,7 @@ package body System.Tasking.Stages is
                --  Adjustments for inner frames
 
                Pattern_Size := Pattern_Size -
-                 (if Pattern_Size < Small_Stack_Limit
+                 (if Pattern_Size < Big_Overflow_Guard
                     then Small_Overflow_Guard
                     else Big_Overflow_Guard);
             else



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-26  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26  8:41 [Ada] Constraint_Error in Task_Wrapper and -u0 Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).