From 21acfdc4ef18fcf2e5e6114fe800fec0a10e493c Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 10 Apr 2025 12:46:52 -0700 Subject: [PATCH] cmd/compile: turn off variable-sized make() stack allocation with -N Give people a way to turn this optimization off. (Currently the constant-sized make() stack allocation is not disabled with -N. Kinda inconsistent, but oh well, probably worse to change it now.) Update #73253 Change-Id: Idb9ffde444f34e70673147fd6a962368904a7a55 Reviewed-on: https://go-review.googlesource.com/c/go/+/664655 Reviewed-by: Dmitri Shuralyov Reviewed-by: Jorropo LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Reviewed-by: t hepudds --- src/cmd/compile/internal/walk/builtin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/walk/builtin.go b/src/cmd/compile/internal/walk/builtin.go index f5e558b471..018782211b 100644 --- a/src/cmd/compile/internal/walk/builtin.go +++ b/src/cmd/compile/internal/walk/builtin.go @@ -568,7 +568,7 @@ func walkMakeSlice(n *ir.MakeExpr, init *ir.Nodes) ir.Node { // The conv is necessary in case n.Type is named. return walkExpr(typecheck.Expr(typecheck.Conv(s, n.Type())), init) } - tryStack = true + tryStack = base.Flag.N == 0 } // The final result is assigned to this variable. -- 2.51.0