]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: mark modify ops as both read and write
authorKeith Randall <khr@golang.org>
Tue, 8 May 2018 15:10:17 +0000 (08:10 -0700)
committerKeith Randall <khr@golang.org>
Tue, 8 May 2018 19:13:58 +0000 (19:13 +0000)
commitdffc915b2daec7ad81524e97f7f5cf72733d3586
treecac5b2b0702300b9afe3f2154ac8d39575fec2e4
parent941b3b77648bb307c71d29b81b03349584f876e6
cmd/compile: mark modify ops as both read and write

If the modify ops operate on a variable, we should tell the liveness
pass that the variable is still live before the instruction.

This looks like a bug, but I don't think there's any way to trigger
it at the moment. It only matters for pointer-containing values, and
the modify ops don't normally work on pointers. Even when I reach for
unsafe.Pointer tricks, I can't get ADDLmodify to work on pointers, as
there's always a Convert or VarDef preventing the coalescing.

TL;DR I can't figure out a test for this. But we should probably
fix it anyway.

Change-Id: I971c62616dec51a33788b7634e6478e1bfcd6260
Reviewed-on: https://go-review.googlesource.com/112157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/gen/386Ops.go
src/cmd/compile/internal/ssa/gen/main.go
src/cmd/compile/internal/ssa/opGen.go