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

Issue 85200043: code review 85200043: cmd/5g, cmd/6g, cmd/8g: preserved wide values in large ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by rsc
Modified:
11 years, 1 month ago
Reviewers:
khr
CC:
khr, bradfitz, dave_cheney.net, golang-codereviews
Visibility:
Public.

Description

cmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions In large functions with many variables, the register optimizer may give up and choose not to track certain variables at all. In this case, the "nextinnode" information linking together all the words from a given variable will be incomplete, and the result may be that only some of a multiword value is preserved across a call. That confuses the garbage collector, so don't do that. Instead, mark those variables as having their address taken, so that they will be preserved at all calls. It's overkill, but correct. Tested by hand using the 6g -S output to see that it does fix the buggy generated code leading to the issue 7726 failure. There is no automated test because I managed to break the compiler while writing a test (see issue 7727). I will check in a test along with the fix to issue 7727. Fixes issue 7726.

Patch Set 1 #

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

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

Patch Set 4 : diff -r 074e5c79d48a https://code.google.com/p/go/ #

Patch Set 5 : diff -r 9e0c5daed8e4 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -0 lines) Patch
M src/cmd/5g/reg.c View 1 1 chunk +10 lines, -0 lines 0 comments Download
M src/cmd/6g/reg.c View 1 3 1 chunk +10 lines, -0 lines 0 comments Download
M src/cmd/8g/reg.c View 1 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 8
rsc
Hello khr (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 1 month ago (2014-04-08 03:00:44 UTC) #1
bradfitz
s/preserved/preserve/ in subject? On Mon, Apr 7, 2014 at 8:00 PM, <rsc@golang.org> wrote: > Reviewers: ...
11 years, 1 month ago (2014-04-08 03:17:17 UTC) #2
rsc
already done. you won't see any more rietveld-generated mails on this thread
11 years, 1 month ago (2014-04-08 03:38:08 UTC) #3
khr
LGTM.
11 years, 1 month ago (2014-04-09 23:59:00 UTC) #4
dave_cheney.net
ping
11 years, 1 month ago (2014-04-16 00:49:45 UTC) #5
rsc
I am not 100% sure this is correct. I want to play with it a ...
11 years, 1 month ago (2014-04-16 00:53:30 UTC) #6
rsc
My hesitation about this was due to 6g crashing on an input file I wrote ...
11 years, 1 month ago (2014-04-16 17:59:25 UTC) #7
rsc
11 years, 1 month ago (2014-04-16 17:59:46 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=04898bb1cd81 ***

cmd/5g, cmd/6g, cmd/8g: preserve wide values in large functions

In large functions with many variables, the register optimizer
may give up and choose not to track certain variables at all.
In this case, the "nextinnode" information linking together
all the words from a given variable will be incomplete, and
the result may be that only some of a multiword value is
preserved across a call. That confuses the garbage collector,
so don't do that. Instead, mark those variables as having
their address taken, so that they will be preserved at all
calls. It's overkill, but correct.

Tested by hand using the 6g -S output to see that it does fix
the buggy generated code leading to the issue 7726 failure.

There is no automated test because I managed to break the
compiler while writing a test (see issue 7727). I will check
in a test along with the fix to issue 7727.

Fixes issue 7726.

LGTM=khr
R=khr, bradfitz, dave
CC=golang-codereviews
https://codereview.appspot.com/85200043
Sign in to reply to this message.

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