mirror of
https://github.com/golang/go
synced 2024-11-23 23:30:10 -07:00
6300161d40
Fold MOVDaddr ops into MOVXstorezero ops. Also fold ADDconst into MOVDaddr so we're sure there isn't (MOVDstorezero (ADDconst (MOVDaddr ..))) Without this CL, we get: v1 = MOVDaddr {s} v2 = VARDEF {s} v3 = MOVDstorezero v1 v2 The liveness pass thinks the MOVDaddr is a read of s, so s is incorrectly thought to be live at the start of the function. Fixes #17194 Change-Id: I2b4a2f13b12aa5b072941ee1c7b89f3793650cdc Reviewed-on: https://go-review.googlesource.com/30086 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Michael Munday <munday@ca.ibm.com>
18 lines
303 B
Go
18 lines
303 B
Go
// compile
|
|
|
|
// Copyright 2016 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.
|
|
|
|
package foo
|
|
|
|
func f(x []interface{}) (err error) {
|
|
for _, d := range x {
|
|
_, ok := d.(*int)
|
|
if ok {
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|