Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(464)

Issue 63570045: code review 63570045: cmd/gc: correct liveness for wrappers containing tail jumps (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by rsc
Modified:
11 years, 4 months ago
Reviewers:
CC:
iant, golang-codereviews
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r bc03ee8d688d https://code.google.com/p/go/ #

Patch Set 3 : diff -r bc03ee8d688d https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -1 line) Patch
M src/cmd/gc/plive.c View 1 2 chunks +25 lines, -1 line 0 comments Download
A test/live1.go View 1 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 2
rsc
Hello iant (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 4 months ago (2014-02-14 04:33:15 UTC) #1
rsc
11 years, 4 months ago (2014-02-14 04:33:23 UTC) #2
*** Submitted as https://code.google.com/p/go/source/detail?r=7e4734277702 ***

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://codereview.appspot.com/63570045
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b