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 <dmitshur@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: t hepudds <thepudds1460@gmail.com>
This commit is contained in:
Keith Randall 2025-04-10 12:46:52 -07:00 committed by Keith Randall
parent 03640f688b
commit 21acfdc4ef

View File

@ -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.