Commit 3965519a authored by Ken Thompson's avatar Ken Thompson

arm reg bug with address(variable)

R=r
CC=golang-dev
https://golang.org/cl/4047041
parent 64324714
...@@ -137,18 +137,16 @@ regopt(Prog *firstp) ...@@ -137,18 +137,16 @@ regopt(Prog *firstp)
uint32 vreg; uint32 vreg;
Bits bit; Bits bit;
return;
if(first == 0) { if(first == 0) {
fmtinstall('Q', Qconv); fmtinstall('Q', Qconv);
} }
first++; first++;
if(debug['K']) { if(debug['K']) {
if(first != 2) if(first != 1)
return; return;
debug['R'] = 2; // debug['R'] = 2;
debug['P'] = 2; // debug['P'] = 2;
print("optimizing %S\n", curfn->nname->sym); print("optimizing %S\n", curfn->nname->sym);
} }
...@@ -644,21 +642,17 @@ mkvar(Reg *r, Adr *a, int docon) ...@@ -644,21 +642,17 @@ mkvar(Reg *r, Adr *a, int docon)
print("type %d %d %D\n", t, a->name, a); print("type %d %d %D\n", t, a->name, a);
goto none; goto none;
case D_CONST:
if(a->reg != NREG)
r->regu |= RtoB(a->reg);
// fallthrough
case D_NONE: case D_NONE:
case D_FCONST: case D_FCONST:
case D_BRANCH: case D_BRANCH:
goto none; break;
case D_REGREG: case D_REGREG:
if(a->offset != NREG) if(a->offset != NREG)
r->regu |= RtoB(a->offset); r->regu |= RtoB(a->offset);
// fallthrough // fallthrough
case D_CONST:
case D_REG: case D_REG:
case D_SHIFT: case D_SHIFT:
case D_OREG: case D_OREG:
...@@ -750,22 +744,8 @@ out: ...@@ -750,22 +744,8 @@ out:
if(n == D_PARAM) if(n == D_PARAM)
for(z=0; z<BITS; z++) for(z=0; z<BITS; z++)
params.b[z] |= bit.b[z]; params.b[z] |= bit.b[z];
if(t == D_CONST)
// if(t == D_CONST) { setaddrs(bit);
// if(s == S) {
// for(z=0; z<BITS; z++)
// consts.b[z] |= bit.b[z];
// return bit;
// }
// if(et != TARRAY)
// for(z=0; z<BITS; z++)
// addrs.b[z] |= bit.b[z];
// for(z=0; z<BITS; z++)
// params.b[z] |= bit.b[z];
// return bit;
// }
// if(t != D_OREG)
// goto none;
return bit; return bit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment