Commit ca6186aa authored by Shenghou Ma's avatar Shenghou Ma

cmd/6c, cmd/8c, cmd/8g: fix print of pc (which is vlong).

While we're at it, fix a wrong for statement in cmd/8g.

LGTM=rsc
R=rsc, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/62700044
parent a3e3b8e9
...@@ -1461,7 +1461,7 @@ fixjmp(Reg *firstr) ...@@ -1461,7 +1461,7 @@ fixjmp(Reg *firstr)
for(r=firstr; r; r=r->link) { for(r=firstr; r; r=r->link) {
p = r->prog; p = r->prog;
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("%04d %P\n", r->pc, p); print("%04d %P\n", (int)r->pc, p);
if(p->as != ACALL && p->to.type == D_BRANCH && r->s2 && r->s2->prog->as == AJMP) { if(p->as != ACALL && p->to.type == D_BRANCH && r->s2 && r->s2->prog->as == AJMP) {
r->s2 = chasejmp(r->s2, &jmploop); r->s2 = chasejmp(r->s2, &jmploop);
p->to.offset = r->s2->pc; p->to.offset = r->s2->pc;
...@@ -1486,7 +1486,7 @@ fixjmp(Reg *firstr) ...@@ -1486,7 +1486,7 @@ fixjmp(Reg *firstr)
// Let it stay. // Let it stay.
} else { } else {
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("del %04d %P\n", r->pc, p); print("del %04d %P\n", (int)r->pc, p);
p->as = ANOP; p->as = ANOP;
} }
} }
...@@ -1499,7 +1499,7 @@ fixjmp(Reg *firstr) ...@@ -1499,7 +1499,7 @@ fixjmp(Reg *firstr)
p = r->prog; p = r->prog;
if(p->as == AJMP && p->to.type == D_BRANCH && r->s2 == r->link) { if(p->as == AJMP && p->to.type == D_BRANCH && r->s2 == r->link) {
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("del %04d %P\n", r->pc, p); print("del %04d %P\n", (int)r->pc, p);
p->as = ANOP; p->as = ANOP;
} }
} }
...@@ -1520,7 +1520,7 @@ fixjmp(Reg *firstr) ...@@ -1520,7 +1520,7 @@ fixjmp(Reg *firstr)
if(debug['R'] && debug['v']) { if(debug['R'] && debug['v']) {
print("\n"); print("\n");
for(r=firstr; r; r=r->link) for(r=firstr; r; r=r->link)
print("%04d %P\n", r->pc, r->prog); print("%04d %P\n", (int)r->pc, r->prog);
print("\n"); print("\n");
} }
} }
......
...@@ -558,7 +558,7 @@ brk: ...@@ -558,7 +558,7 @@ brk:
if(debug['R'] && debug['v']) { if(debug['R'] && debug['v']) {
print("after pass 7 (peep)\n"); print("after pass 7 (peep)\n");
for(r=firstr; r; r=r->link) for(r=firstr; r; r=r->link)
print("%04d %P\n", r->pc, r->prog); print("%04d %P\n", (int)r->pc, r->prog);
print("\n"); print("\n");
} }
...@@ -1375,7 +1375,7 @@ fixjmp(Reg *firstr) ...@@ -1375,7 +1375,7 @@ fixjmp(Reg *firstr)
for(r=firstr; r; r=r->link) { for(r=firstr; r; r=r->link) {
p = r->prog; p = r->prog;
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("%04d %P\n", r->pc, p); print("%04d %P\n", (int)r->pc, p);
if(p->as != ACALL && p->to.type == D_BRANCH && r->s2 && r->s2->prog->as == AJMP) { if(p->as != ACALL && p->to.type == D_BRANCH && r->s2 && r->s2->prog->as == AJMP) {
r->s2 = chasejmp(r->s2, &jmploop); r->s2 = chasejmp(r->s2, &jmploop);
p->to.offset = r->s2->pc; p->to.offset = r->s2->pc;
...@@ -1400,7 +1400,7 @@ fixjmp(Reg *firstr) ...@@ -1400,7 +1400,7 @@ fixjmp(Reg *firstr)
// Let it stay. // Let it stay.
} else { } else {
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("del %04d %P\n", r->pc, p); print("del %04d %P\n", (int)r->pc, p);
p->as = ANOP; p->as = ANOP;
} }
} }
...@@ -1413,7 +1413,7 @@ fixjmp(Reg *firstr) ...@@ -1413,7 +1413,7 @@ fixjmp(Reg *firstr)
p = r->prog; p = r->prog;
if(p->as == AJMP && p->to.type == D_BRANCH && r->s2 == r->link) { if(p->as == AJMP && p->to.type == D_BRANCH && r->s2 == r->link) {
if(debug['R'] && debug['v']) if(debug['R'] && debug['v'])
print("del %04d %P\n", r->pc, p); print("del %04d %P\n", (int)r->pc, p);
p->as = ANOP; p->as = ANOP;
} }
} }
...@@ -1434,7 +1434,7 @@ fixjmp(Reg *firstr) ...@@ -1434,7 +1434,7 @@ fixjmp(Reg *firstr)
if(debug['R'] && debug['v']) { if(debug['R'] && debug['v']) {
print("\n"); print("\n");
for(r=firstr; r; r=r->link) for(r=firstr; r; r=r->link)
print("%04d %P\n", r->pc, r->prog); print("%04d %P\n", (int)r->pc, r->prog);
print("\n"); print("\n");
} }
} }
......
...@@ -1138,7 +1138,7 @@ dumpit(char *str, Flow *r0, int isreg) ...@@ -1138,7 +1138,7 @@ dumpit(char *str, Flow *r0, int isreg)
r1 = r->p2; r1 = r->p2;
if(r1 != nil) { if(r1 != nil) {
print(" pred:"); print(" pred:");
for(; r1 != nil; r1 = r->p2link) for(; r1 != nil; r1 = r1->p2link)
print(" %.4ud", (int)r1->prog->pc); print(" %.4ud", (int)r1->prog->pc);
print("\n"); print("\n");
} }
......
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