Skip to content

Commit 554daa0

Browse files
Rollup merge of #131116 - mustartt:aix-stack-size, r=petrochenkov
Increase Stack Size for AIX On AIX, there are limited support for tail call optimizations, so we need to set a larger stack size value. Fixes the following tests on AIX: ``` [ui] tests/ui/associated-consts/issue-93775.rs [ui] tests/ui/closures/deeply-nested_closures.rs [ui] tests/ui/issues/issue-74564-if-expr-stack-overflow.rs [ui] tests/ui/parser/survive-peano-lesson-queue.rs ```
2 parents 5a8fcab + 162ee75 commit 554daa0

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_data_structures/src

1 file changed

+4
-0
lines changed

compiler/rustc_data_structures/src/stack.rs

+4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ const RED_ZONE: usize = 100 * 1024; // 100k
55

66
// Only the first stack that is pushed, grows exponentially (2^n * STACK_PER_RECURSION) from then
77
// on. This flag has performance relevant characteristics. Don't set it too high.
8+
#[cfg(not(target_os = "aix"))]
89
const STACK_PER_RECURSION: usize = 1024 * 1024; // 1MB
10+
// LLVM for AIX doesn't feature TCO, increase recursion size for workaround.
11+
#[cfg(target_os = "aix")]
12+
const STACK_PER_RECURSION: usize = 16 * 1024 * 1024; // 16MB
913

1014
/// Grows the stack on demand to prevent stack overflow. Call this in strategic locations
1115
/// to "break up" recursive calls. E.g. almost any call to `visit_expr` or equivalent can benefit

0 commit comments

Comments
 (0)