diff options
| author | Keith Randall <khr@golang.org> | 2024-06-12 20:24:44 -0700 |
|---|---|---|
| committer | Keith Randall <khr@google.com> | 2024-07-23 20:55:24 +0000 |
| commit | b0f7be3cfa1ee5fbfe46590475861677cc9514fa (patch) | |
| tree | 6b5d26c101d51df9e9ae504cd36f26b29355d5e6 /src/cmd | |
| parent | f66db499769002f1f804f52234b7c3e5917bbad6 (diff) | |
| download | go-b0f7be3cfa1ee5fbfe46590475861677cc9514fa.tar.xz | |
cmd/compile: don't treat an InlMark as a read during deadstore
An InlMark "read" can't make an otherwise dead store live. Without this
CL, we sometimes zero an object twice in succession because we think
there is a reader in between.
Kind of challenging to make a test for this. The second zeroing has the
same instruction on the same line number, so codegen tests can't see it.
Fixes #67957
Change-Id: I7fb97ebff50d8eb6246fc4802d1136b7cc76c45f
Reviewed-on: https://go-review.googlesource.com/c/go/+/592615
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>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/compile/internal/ssa/deadstore.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/deadstore.go b/src/cmd/compile/internal/ssa/deadstore.go index ce04cb3a24..a0d61bad03 100644 --- a/src/cmd/compile/internal/ssa/deadstore.go +++ b/src/cmd/compile/internal/ssa/deadstore.go @@ -59,6 +59,10 @@ func dse(f *Func) { continue } } + if v.Op == OpInlMark { + // Not really a use of the memory. See #67957. + continue + } for _, a := range v.Args { if a.Block == b && a.Type.IsMemory() { loadUse.add(a.ID) |
