]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: fix liveness regression
authorMatthew Dempsky <mdempsky@google.com>
Tue, 21 Mar 2017 17:15:14 +0000 (10:15 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 21 Mar 2017 17:46:25 +0000 (17:46 +0000)
commitbaa0fdd0934cb9dca88ea0effb46cf42089c9ccd
treebaf1ffebc8d1de629ef0e7544425b86452f196b2
parent2e29eb57dbd2bc7b022fadc33943b0a5ee69324d
cmd/compile/internal/gc: fix liveness regression

During AllocFrame, we drop unused variables from Curfn.Func.Dcl, but
there might still be OpVarFoo instructions that reference those
variables. This wasn't a problem though because gvardefx used to emit
ANOP for unused variables instead of AVARFOO.

As an easy fix, if we see OpVarFoo (or OpKeepAlive) referencing an
unused variable, we can ignore it.

Fixes #19632.

Change-Id: I4e9ffabdb4058f7cdcc4663b540f5a5a692daf8b
Reviewed-on: https://go-review.googlesource.com/38400
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/plive.go