Hi.

This is the second version of this patch.  In this version:
- I've also modified gcc.cc instead of just toplev.cc (so both places in GCC's
  codebase where 'stack_limit_increase ()' gets called are now patched
- I correctly request more memory when GCC *is* built with ASAN.  I switched
  that around in v1.

Please also consider this to be a ping.

Btw, if this isn't a stage 4 material, do tell me and I'll postpone pinging to
stage 1 :).

Cheers,
Filip Kastl

-- 8< --


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 <[email protected]>
---
 gcc/gcc.cc    | 4 ++++
 gcc/toplev.cc | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 43b0158ee02..d6a26ebcd18 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -8423,7 +8423,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 682459220a2..26a2b582ed9 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -2301,7 +2301,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.  */
-- 
2.51.0

Reply via email to