From: Than McIntosh Date: Tue, 30 May 2023 14:49:11 +0000 (-0400) Subject: cmd/compile: remove special treatment for cover vars in initorder X-Git-Tag: go1.21rc1~186 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5b603f79fb51e7be4c7d7d141c7615b9cdc58524;p=gostls13.git cmd/compile: remove special treatment for cover vars in initorder This patch reverts a portion of the changes in CL 443715, specifically the code in initorder that treats coverage counter variables as special with respect to init order. The special casing is no longer needed now after a change to the way coverage instrumention is done (the go and cover cmds now make sure that coverage variables appear first in the compilation order). Updates #56293. Change-Id: Idf803ff4c1a095e88d455a6adcd63991687eb288 Reviewed-on: https://go-review.googlesource.com/c/go/+/499216 Run-TryBot: Than McIntosh Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/pkginit/initorder.go b/src/cmd/compile/internal/pkginit/initorder.go index db24264989..9416470ca1 100644 --- a/src/cmd/compile/internal/pkginit/initorder.go +++ b/src/cmd/compile/internal/pkginit/initorder.go @@ -321,15 +321,6 @@ func (d *initDeps) foundDep(n *ir.Name) { return } - // Treat coverage counter variables effectively as invisible with - // respect to init order. If we don't do this, then the - // instrumentation vars can perturb the order of initialization - // away from the order of the original uninstrumented program. - // See issue #56293 for more details. - if n.CoverageCounter() || n.CoverageAuxVar() { - return - } - if d.seen.Has(n) { return }