]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill...
authorKeith Randall <khr@golang.org>
Wed, 24 May 2017 05:55:59 +0000 (22:55 -0700)
committerKeith Randall <khr@golang.org>
Wed, 24 May 2017 15:44:39 +0000 (15:44 +0000)
commit439c0c8be85f93306460d82ad12b47c56ee53420
tree209e29fc1e6040855847ce28a7d0888f3a023eb1
parente396667ba31b971a892bf48229071aed93da1499
[release-branch.go1.8] cmd/compile: don't move spills to loop exits where the spill is dead

We shouldn't move a spill to a loop exit where the spill itself
is dead.  The stack location assigned to the spill might already
be reused by another spill at this point.

The case we previously handled incorrectly is the one where the value
being spilled is still live, but the spill itself is dead.

Fixes #20472

Patching directly on the release branch because the spill moving code has
already been rewritten for 1.9. (And it doesn't have this bug.)

Change-Id: I26c5273dafd98d66ec448750073c2b354ef89ad6
Reviewed-on: https://go-review.googlesource.com/44033
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/regalloc.go
src/cmd/compile/internal/ssa/regalloc_test.go