]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
toplev: Ask for 128MB stack when compiled with ASAN [PR124206]
authorFilip Kastl <fkastl@suse.cz>
Mon, 15 Jun 2026 12:20:58 +0000 (14:20 +0200)
committerFilip Kastl <fkastl@suse.cz>
Mon, 15 Jun 2026 12:20:58 +0000 (14:20 +0200)
64MB stack is not enough for running
gcc/testsuite/gcc.c-torture/compile/limits-exprparen.c with an
ASAN-instrumented GCC.  Ask for more stack if GCC was compiled with ASAN
instrumentation.

PR sanitizer/124206

gcc/ChangeLog:

* gcc.cc (driver::global_initializations): Ask for 128MB stack
instead of just 64MB when __SANITIZE_ADDRESS__ is defined.
* toplev.cc (toplev::main): Ditto.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
gcc/gcc.cc
gcc/toplev.cc

index 9ef2a21745a4b4ec8f5f66d59f180e6955c90505..c7a5ac2484e7bdf9b398b89020b3aadb699d9070 100644 (file)
@@ -8517,7 +8517,11 @@ driver::global_initializations ()
 
   /* Parsing and gimplification sometimes need quite large stack.
      Increase stack size limits if possible.  */
+#ifdef __SANITIZE_ADDRESS__
+  stack_limit_increase (128 * 1024 * 1024);
+#else
   stack_limit_increase (64 * 1024 * 1024);
+#endif
 
   /* Allocate the argument vector.  */
   alloc_args ();
index 3d4319fa3286c2f3614df962347f39b7dab905ba..30f5a3d00639dd561bae4218e7352dd1807d97c3 100644 (file)
@@ -2304,7 +2304,11 @@ toplev::main (int argc, char **argv)
 {
   /* Parsing and gimplification sometimes need quite large stack.
      Increase stack size limits if possible.  */
+#ifdef __SANITIZE_ADDRESS__
+  stack_limit_increase (128 * 1024 * 1024);
+#else
   stack_limit_increase (64 * 1024 * 1024);
+#endif
 
   /* Stash a copy of the original argv before expansion
      for use by SARIF output.  */