diff --git a/src/cmd/7g/prog.go b/src/cmd/7g/prog.go index 4afb29b89ab..f503f78ef12 100644 --- a/src/cmd/7g/prog.go +++ b/src/cmd/7g/prog.go @@ -57,7 +57,7 @@ var progtable = [arm64.ALAST]obj.ProgInfo{ arm64.ALSL: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, arm64.ALSR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, arm64.AASR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, - arm64.ACMP: {gc.SizeQ | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm64.ACMP: {gc.SizeQ | gc.LeftRead | gc.RegRead, 0, 0, 0}, // Floating point. arm64.AFADDD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, diff --git a/test/fixedbugs/issue10253.go b/test/fixedbugs/issue10253.go new file mode 100644 index 00000000000..fafca6c733e --- /dev/null +++ b/test/fixedbugs/issue10253.go @@ -0,0 +1,26 @@ +// run + +// Copyright 2015 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. + +// issue 10253: cmd/7g: bad codegen, probably regopt related + +package main + +func main() { + if !eq() { + panic("wrong value") + } +} + +var text = "abc" +var s = &str{text} + +func eq() bool { + return text[0] == s.text[0] +} + +type str struct { + text string +}