[gcc r17-1567] toplev: Ask for 128MB stack when compiled with ASAN [PR124206]
Filip Kastl
pheeck@gcc.gnu.org
Mon Jun 15 12:22:14 GMT 2026
https://gcc.gnu.org/g:7b0d9d02aff02cd04897fea15feff0c5ba01b79c
commit r17-1567-g7b0d9d02aff02cd04897fea15feff0c5ba01b79c
Author: Filip Kastl <fkastl@suse.cz>
Date: Mon Jun 15 14:20:58 2026 +0200
toplev: Ask for 128MB stack when compiled with ASAN [PR124206]
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>
Diff:
---
gcc/gcc.cc | 4 ++++
gcc/toplev.cc | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 9ef2a21745a4..c7a5ac2484e7 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -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 ();
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index 3d4319fa3286..30f5a3d00639 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -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. */
More information about the Gcc-cvs
mailing list