1
0
mirror of https://github.com/golang/go synced 2024-11-12 00:30:22 -07:00
go/test/fixedbugs/issue22429.go
Keith Randall 40649e6979 cmd/compile: make sure not to use SP as an index register
...because that's an illegal addressing mode.

I double-checked handling of this code, and 387 is the only
place where this check is missing.

Fixes #22429

Change-Id: I2284fe729ea86251c6af2f04076ddf7a5e66367c
Reviewed-on: https://go-review.googlesource.com/73551
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-26 02:45:05 +00:00

19 lines
369 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.
// Make sure SSA->assembly pass can handle SP as an index register.
package p
type T struct {
a,b,c,d float32
}
func f(a *[8]T, i,j,k int) float32 {
b := *a
return b[i].a + b[j].b + b[k].c
}