cl,goflags: implement maymorestack debug hook - #2260
Conversation
There was a problem hiding this comment.
Review: maymorestack debug hook
Solid, well-scoped implementation. The -d=maymorestack= flag parsing, all= vs. command-line package scoping, fingerprint/manifest integration, and eligibility logic (skip synthetic / //go:nosplit / self-recursion) all track Go's real maymorestack semantics, and test coverage is thorough (cl internal, build-scope, fingerprint, goflags matrix, and an end-to-end goroot-style test). Removing the maymorestack.go xfail entries is well-supported by the new tests. Findings below are minor; the two worth addressing before merge are the nosplit-match brittleness and the doc-comment attachment.
Findings not tied to a diff line:
doc/design/pclntab-packaging.md:92— the design doc states the-gcflagsfrontend subset is "(-lang,-N, and-l)". This PR adds-d=maymorestack=as a fourth frontend-interpreted gcflag mapped to typedConfigfields, so that enumeration is now out of date and should include it. (File is outside the PR diff, so noted here.)
Inline comments cover the remaining findings.
|
Addressed all current review findings in
Focused validation passes:
A separate full |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
No main baseline exists yet; all metrics are marked Warning
|
Summary
all=forms of-gcflags=-d=maymorestack=<hook>ininternal/goflagscl.Options, without process-wide compiler state//go:nosplitfunctionsall=affects dependencies tooRoot cause
The runner already forwarded
-gcflags, but LLGo did not translate themaymorestackdebug option into frontend behavior. The old local prototype predatedinternal/goflagsand used process-wide state plus repeated command wiring. This version reuses the current Go-compatible flag path and the frontend option isolation added on current main.The official exact-count test also guards package scope: applying an unpatterned flag to dependencies would produce more than the expected 128 calls. Unit coverage adds the separate
-dspelling, comma-separated debug options, last-list clearing,all=scope,//go:nosplit, cache isolation, and consecutive compilation isolation.Validation
go test ./internal/goflags -count=1go test -race ./internal/goflags -run "MayMoreStack|FrontendGCFlag" -count=1clandinternal/buildmaymorestack testsgo test ./cmd/internal/flags ./cmd/internal/build ./cmd/internal/run ./cmd/internal/test ./cmd/internal/install -count=1TestMayMoreStackGCFlagtest/maymorestack.gowith an empty xfail set on Go 1.24.11, 1.25.7, and 1.26.5git diff --check upstream/main...HEADNo CI timing/configuration, wasm, DWARF, PCLN, pthread, TLS, or unrelated runtime behavior is changed.