mkvar was taking care of the "LeftAddr" case,
effectively hiding it from the temp-merging optimization.
Move it into prog.c.
R=ken2
CC=golang-dev
https://golang.org/cl/
12884045
if(info->flags == 0)
fatal("unknown instruction %P", p);
+ if(p->from.type == D_CONST && p->from.sym != nil && (info->flags & LeftRead)) {
+ info->flags &= ~LeftRead;
+ info->flags |= LeftAddr;
+ }
+
if((info->flags & RegRead) && p->reg == NREG) {
info->flags &= ~RegRead;
info->flags |= CanRegRead | RightRead;
if(p->as == ABL && p->to.type == D_EXTERN)
continue;
- if(info.flags & LeftRead) {
- bit = mkvar(r, &p->from);
+ bit = mkvar(r, &p->from);
+ if(info.flags & LeftRead)
for(z=0; z<BITS; z++)
r->use1.b[z] |= bit.b[z];
- }
+ if(info.flags & LeftAddr)
+ setaddrs(bit);
if(info.flags & RegRead) {
if(p->from.type != D_FREG)
case D_BRANCH:
break;
- case D_CONST:
- flag = 1;
- goto onereg;
case D_REGREG:
case D_REGREG2:
bit.b[0] |= RtoB(a->reg);
return bit;
+ case D_CONST:
case D_REG:
case D_SHIFT:
- onereg:
if(a->reg != NREG) {
bit = zbits;
bit.b[0] = RtoB(a->reg);