From: Filip Kastl Date: Mon, 15 Jun 2026 12:20:58 +0000 (+0200) Subject: toplev: Ask for 128MB stack when compiled with ASAN [PR124206] X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b0d9d02aff02cd04897fea15feff0c5ba01b79c;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 9ef2a21745a..c7a5ac2484e 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 3d4319fa328..30f5a3d0063 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. */