In addition to duplicating the logic, the old code was
clearing the line number, which led to missing source line
information in the -S output.
Also fix nopout, which was incomplete.
Change-Id: Ic2b596a2f9ec2fe85642ebe125cca8ef38c83085
Reviewed-on: https://go-review.googlesource.com/3512
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dave Cheney <dave@cheney.net>
nopout(Prog *p)
{
p->as = ANOP;
+ p->from = zprog.from;
+ p->from3 = zprog.from3;
+ p->reg = zprog.reg;
+ p->to = zprog.to;
}
-
void
excise(Flow *r)
{
- Prog *p, *l;
+ Prog *p;
p = r->prog;
if(debug['P'] && debug['v'])
print("%P ===delete===\n", p);
- l = p->link;
- *p = zprog;
- p->as = ANOP;
- p->link = l;
+ nopout(p);
ostats.ndelmov++;
}