]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: correct liveness for wrappers containing tail jumps
authorRuss Cox <rsc@golang.org>
Fri, 14 Feb 2014 04:33:20 +0000 (23:33 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 14 Feb 2014 04:33:20 +0000 (23:33 -0500)
commit02ae91f3424d45820a5b98ddc2595680666a97e0
tree6abfac1843cb788b43fb52d2f107ebb2216e27e0
parent91b1f7cb15700f39ca63c4e056b41d9b04100e97
cmd/gc: correct liveness for wrappers containing tail jumps

A normal RET is treated as using the return values,
but a tail jump RET does not - it is jumping to the
function that is going to fill in the return values.
If a tail jump RET is recorded as using the return values,
since nothing initializes them they will be marked as
live on entry to the function, which is clearly wrong.

Found and tested by the new code in plive.c that looks
for variables that are incorrectly live on entry.
That code is disabled for now because there are other
cases remaining to be fixed. But once it is enabled,
test/live1.go becomes a real test of this CL.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/63570045
src/cmd/gc/plive.c
test/live1.go [new file with mode: 0644]