FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
cmd/6g, cmd/8g: mark used registers in indirect addressing.

Fixes issue 4094.
Fixes issue 4353.

Please review this at http://codereview.appspot.com/6810090/

Affected files:
M src/cmd/6g/reg.c
M src/cmd/8g/reg.c


Index: src/cmd/6g/reg.c
===================================================================
--- a/src/cmd/6g/reg.c
+++ b/src/cmd/6g/reg.c
@@ -247,6 +247,16 @@
}
}

+ // Addressing makes some registers used.
+ if(p->from.type >= D_INDIR)
+ r->use1.b[0] |= RtoB(p->from.type-D_INDIR);
+ if(p->from.index != D_NONE)
+ r->use1.b[0] |= RtoB(p->from.index);
+ if(p->to.type >= D_INDIR)
+ r->use2.b[0] |= RtoB(p->to.type-D_INDIR);
+ if(p->to.index != D_NONE)
+ r->use2.b[0] |= RtoB(p->to.index);
+
bit = mkvar(r, &p->from);
if(bany(&bit))
switch(p->as) {
Index: src/cmd/8g/reg.c
===================================================================
--- a/src/cmd/8g/reg.c
+++ b/src/cmd/8g/reg.c
@@ -212,6 +212,16 @@
}
}

+ // Addressing makes some registers used.
+ if(p->from.type >= D_INDIR)
+ r->use1.b[0] |= RtoB(p->from.type-D_INDIR);
+ if(p->from.index != D_NONE)
+ r->use1.b[0] |= RtoB(p->from.index);
+ if(p->to.type >= D_INDIR)
+ r->use2.b[0] |= RtoB(p->to.type-D_INDIR);
+ if(p->to.index != D_NONE)
+ r->use2.b[0] |= RtoB(p->to.index);
+
bit = mkvar(r, &p->from);
if(bany(&bit))
switch(p->as) {

Search Discussions

  • Remyoudompheng at Nov 6, 2012 at 11:23 pm
    The fixes issue 4094 is a bit hypothetical, it is a bit hard to actually
    reproduce. But in some sense, the issue is just as much hypothetical.

    http://codereview.appspot.com/6810090/
  • Dave Cheney at Nov 6, 2012 at 11:26 pm
    Is it possible to include the sample code from 4353 as in src/test ?
    On Wed, Nov 7, 2012 at 10:22 AM, wrote:
    The fixes issue 4094 is a bit hypothetical, it is a bit hard to actually
    reproduce. But in some sense, the issue is just as much hypothetical.

    http://codereview.appspot.com/6810090/
  • Remyoudompheng at Nov 6, 2012 at 11:37 pm
    Hello golang-dev@googlegroups.com, dave@cheney.net (cc:
    golang-dev@googlegroups.com),

    Please take another look.


    http://codereview.appspot.com/6810090/
  • Dave at Nov 6, 2012 at 11:56 pm
    Thank you for adding the test. I wanted to make sure that the test
    passed on arm, and it does.

    https://codereview.appspot.com/6810090/
  • Rsc at Nov 7, 2012 at 2:22 pm
    LGTM

    Thanks very much for tracking that down.


    https://codereview.appspot.com/6810090/
  • Remyoudompheng at Nov 7, 2012 at 8:36 pm
    *** Submitted as
    http://code.google.com/p/go/source/detail?r=aae11629f3e8 ***

    cmd/6g, cmd/8g: mark used registers in indirect addressing.

    Fixes issue 4094.
    Fixes issue 4353.

    R=golang-dev, dave, rsc
    CC=golang-dev
    http://codereview.appspot.com/6810090


    http://codereview.appspot.com/6810090/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 6, '12 at 11:19p
activeNov 7, '12 at 8:36p
posts7
users3
websitegolang.org

3 users in discussion

Remyoudompheng: 4 posts Dave: 2 posts Rsc: 1 post

People

Translate

site design / logo © 2022 Grokbase