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

Issue 154540044: code review 154540044: cmd/gc: emit code for extern = <N> (Closed)

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

Description

cmd/gc: emit code for extern = <N> https://codereview.appspot.com/152700045/ made it possible for struct literals assigned to globals to use <N> as the RHS. Normally, this is to zero out variables on first use. Because globals are already zero (or their linker initialized value), we just ignored this. Now that <N> can occur from non-initialization code, we need to emit this code. We don't use <N> for initialization of globals any more, so this shouldn't cause any excessive zeroing. Fixes issue 8961.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -7 lines) Patch
M src/cmd/gc/gen.c View 1 1 chunk +3 lines, -7 lines 0 comments Download
A test/fixedbugs/issue8961.go View 1 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 3
DMorsing
Hello golang-codereviews@googlegroups.com (cc: bradfitz@golang.org, rsc@golang.org), I'd like you to review this change to https://code.google.com/p/go/
10 years, 4 months ago (2014-10-20 12:44:10 UTC) #1
rsc
LGTM
10 years, 4 months ago (2014-10-20 14:47:53 UTC) #2
DMorsing
10 years, 4 months ago (2014-10-20 14:59:16 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=98477b56eb36 ***

cmd/gc: emit code for extern = <N>

https://codereview.appspot.com/152700045/ made it possible for struct literals
assigned to globals to use <N> as the RHS. Normally, this is to zero out
variables on first use. Because globals are already zero (or their linker
initialized value), we just ignored this.

Now that <N> can occur from non-initialization code, we need to emit this code.
We don't use <N> for initialization of globals any more, so this shouldn't cause
any excessive zeroing.

Fixes issue 8961.

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

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