]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix runtime.KeepAlive
authorKeith Randall <khr@golang.org>
Sat, 28 Oct 2017 17:14:08 +0000 (10:14 -0700)
committerKeith Randall <khr@golang.org>
Mon, 30 Oct 2017 19:55:02 +0000 (19:55 +0000)
commit0153a4130d99dace3b4fb0e1242aae30832fa742
tree49f6cc27962218afb6066496ddb9c92aec56c21a
parentb09e2de735ede5078cde2c2d10cceaeb1ab72cd1
cmd/compile: fix runtime.KeepAlive

KeepAlive needs to introduce a use of the spill of the
value it is keeping alive.  Without that, we don't guarantee
that the spill dominates the KeepAlive.

This bug was probably introduced with the code to move spills
down to the dominator of the restores, instead of always spilling
just after the value itself (CL 34822).

Fixes #22458.

Change-Id: I94955a21960448ffdacc4df775fe1213967b1d4c
Reviewed-on: https://go-review.googlesource.com/74210
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/regalloc.go
test/fixedbugs/issue22458.go [new file with mode: 0644]