From fbfc18c52281a4ac6dd812274e9a3b4774f77f76 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 20 Oct 2015 13:56:16 -0700 Subject: [PATCH] [dev.ssa] cmd/compile: don't issue nops for static data It confuses live variable analysis to have a bunch of unreachable no-ops at the end of a function. Symptom is: gc/plive.go:483 panic: interface conversion: interface {} is nil, not *gc.BasicBlock I don't see any reason why the old compiler needs these no-ops either. all.bash passes with the equivalent code removed on master. Change-Id: Ifcd2c3e139aa16314f08aebc9079b2fb7aa60556 Reviewed-on: https://go-review.googlesource.com/16132 Reviewed-by: David Chase --- src/cmd/compile/internal/gc/sinit.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index 70d32f75c6..c1165cde05 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -1431,9 +1431,6 @@ func gen_as_init(n *Node, reportOnly bool) bool { case OSLICEARR: if nr.Right.Op == OKEY && nr.Right.Left == nil && nr.Right.Right == nil { nr = nr.Left - if !reportOnly { - gused(nil) // in case the data is the dest of a goto - } nl := nr if nr == nil || nr.Op != OADDR { goto no -- 2.48.1