]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: keep autos if their address reaches a control value
authorMichael Munday <mike.munday@ibm.com>
Tue, 17 Jul 2018 07:39:30 +0000 (08:39 +0100)
committerMichael Munday <mike.munday@ibm.com>
Tue, 17 Jul 2018 14:58:54 +0000 (14:58 +0000)
commit1546ab5a3925b07c86f05ccfa4c8b4c2b818790e
treecf72fa9d67043c73136a39a3815045397a5aedc4
parent5890e25b7ccb2d2249b2f8a02ef5dbc36047868b
cmd/compile: keep autos if their address reaches a control value

Autos must be kept if their address reaches the control value of a
block. We didn't see this before because it is rare for an auto's
address to reach a control value without also reaching a phi or
being written to memory. We can probably optimize away the
comparisons that lead to this scenario since autos cannot alias
with pointers from elsewhere, however for now we take the
conservative approach and just ensure the auto is properly
initialised if its address reaches a control value.

Fixes #26407.

Change-Id: I02265793f010a9e001c3e1a5397c290c6769d4de
Reviewed-on: https://go-review.googlesource.com/124335
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/deadstore.go
test/fixedbugs/issue26407.go [new file with mode: 0644]