mirror of
https://github.com/golang/go
synced 2024-09-05 07:54:46 +00:00
![Josh Bleecher Snyder](/assets/img/avatar_default.png)
Simple phi insertion already had a heuristic to check for dead blocks, namely having no predecessors. When we stopped generating code for dead blocks, we eliminated some values contained in more subtle dead blocks, which confused phi insertion. Compensate by beefing up the reachability check. Fixes #19678 Change-Id: I0081e4a46f7ce2f69b131a34a0553874a0cb373e Reviewed-on: https://go-review.googlesource.com/38602 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
22 lines
337 B
Go
22 lines
337 B
Go
// compile
|
|
|
|
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Used to crash when compiling functions containing
|
|
// forward refs in dead code.
|
|
|
|
package p
|
|
|
|
var f func(int)
|
|
|
|
func g() {
|
|
l1:
|
|
i := 0
|
|
goto l1
|
|
l2:
|
|
f(i)
|
|
goto l2
|
|
}
|