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

Issue 11107044: code review 11107044: cmd/gc: avoid passing unevaluated constant expressions ... (Closed)

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

Description

cmd/gc: avoid passing unevaluated constant expressions to backends. Backends do not exactly expect receiving binary operators with constant operands or use workarounds to move them to register/stack in order to handle them. Fixes issue 5841.

Patch Set 1 #

Patch Set 2 : diff -r eed70e6ddb4b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r eed70e6ddb4b https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 4 : diff -r 3bf9ffdcca1f https://go.googlecode.com/hg/ #

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

Messages

Total messages: 12
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 9 months ago (2013-07-11 07:18:19 UTC) #1
DMorsing
This change is weird. I think you're papering over some deeper issue in the compilers. ...
10 years, 9 months ago (2013-07-11 08:20:50 UTC) #2
DMorsing
Ok, I think the compiler is trying to optimize y%1 too eagerly. For example, this ...
10 years, 9 months ago (2013-07-11 08:45:04 UTC) #3
rsc
I agree with Daniel. The fix should probably be in the front end.
10 years, 9 months ago (2013-07-11 18:00:32 UTC) #4
remyoudompheng
https://codereview.appspot.com/11107044/diff/5005/src/cmd/6g/cgen.c File src/cmd/6g/cgen.c (right): https://codereview.appspot.com/11107044/diff/5005/src/cmd/6g/cgen.c#newcode1240 src/cmd/6g/cgen.c:1240: if(!nl->addable) { On 2013/07/11 08:20:51, DMorsing wrote: > I'm ...
10 years, 9 months ago (2013-07-11 21:27:27 UTC) #5
remyoudompheng
On 2013/07/11 08:45:04, DMorsing wrote: > Ok, I think the compiler is trying to optimize ...
10 years, 9 months ago (2013-07-20 10:19:47 UTC) #6
DMorsing
On 2013/07/20 10:19:47, remyoudompheng wrote: > On 2013/07/11 08:45:04, DMorsing wrote: > > Ok, I ...
10 years, 9 months ago (2013-07-20 12:42:46 UTC) #7
rsc
Can you please make this CL only include the change in cmd/gc? That's the part ...
10 years, 9 months ago (2013-07-22 23:58:42 UTC) #8
rsc
https://codereview.appspot.com/11107044/diff/5005/src/cmd/gc/walk.c File src/cmd/gc/walk.c (right): https://codereview.appspot.com/11107044/diff/5005/src/cmd/gc/walk.c#newcode1382 src/cmd/gc/walk.c:1382: evconst(n); // Expressions that are constant at run time ...
10 years, 9 months ago (2013-07-23 00:01:23 UTC) #9
remyoudompheng
Hello golang-dev@googlegroups.com, daniel.morsing@gmail.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 9 months ago (2013-07-24 06:46:52 UTC) #10
rsc
LGTM
10 years, 9 months ago (2013-07-25 13:41:26 UTC) #11
rsc
10 years, 9 months ago (2013-07-25 13:42:06 UTC) #12
*** Submitted as https://code.google.com/p/go/source/detail?r=5baf6060648e ***

cmd/gc: avoid passing unevaluated constant expressions to backends.

Backends do not exactly expect receiving binary operators with
constant operands or use workarounds to move them to
register/stack in order to handle them.

Fixes issue 5841.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://codereview.appspot.com/11107044

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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