Unified · Split
| @@ -304,12 +304,19 @@ coalesce(Fn *fn) · 303 unmodified lines | ||
| 304 | 304 | for (u=t->use; u<&t->use[t->nuse]; u++) { |
| 305 | 305 | assert(u->type == UIns); |
| 306 | 306 | i = u->u.ins; |
| 307 | − if (!req(i->to, R)) { | |
| 307 | + /* make loads crash */ | |
| 308 | + if (isload(i->op)) | |
| 309 | + i->arg[0] = CON_Z; | |
| 310 | + else if (i->op == Oargc) | |
| 311 | + i->arg[1] = CON_Z; | |
| 312 | + else if (!req(i->to, R)) { | |
| 308 | 313 | assert(rtype(i->to) == RTmp); |
| 309 | 314 | vgrow(&stk, ++n); |
| 310 | 315 | stk[n-1] = i->to.val; |
| 311 | − } else | |
| 316 | + } else { | |
| 317 | + assert(!isarg(i->op)); | |
| 312 | 318 | *i = (Ins){.op = Onop}; |
| 319 | + } | |
| 313 | 320 | } |
| 314 | 321 | } |
| 315 | 322 | vfree(stk); |