0
1
mirror of https://github.com/golang/go synced 2025-04-07 23:54:28 +00:00
Files
khr@golang.org cc16fb52e6 cmd/compile: ensure we don't reuse temporary register
Before this CL, we could use the same register for both a temporary
register and for moving a value in the output register out of the way.

Fixes 

Change-Id: Iefbfd9d4139136174570d8aadf8a0fb391791ea9
Reviewed-on: https://go-review.googlesource.com/c/go/+/651221
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2025-02-25 10:19:25 -08:00

30 lines
486 B
Go

// run
// Copyright 2025 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 main
import "sync/atomic"
//go:noinline
func f(p0, p1, p2, p3, p4, p5, p6, p7 *uint64, a *atomic.Uint64) {
old := a.Or(0xaaa)
*p0 = old
*p1 = old
*p2 = old
*p3 = old
*p4 = old
*p5 = old
*p6 = old
*p7 = old
}
func main() {
a := new(atomic.Uint64)
p := new(uint64)
f(p, p, p, p, p, p, p, p, a)
}