From 43967b6306aa18903b3ba2b00e701facaf306840 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 19 Apr 2016 11:07:07 -0400 Subject: use assert for ssa invariants in fold/copy --- copy.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'copy.c') diff --git a/copy.c b/copy.c index 0ed62b0..71720f9 100644 --- a/copy.c +++ b/copy.c @@ -65,11 +65,9 @@ visitins(Ins *i, Ref *cp, RList **w) } static void -subst(Ref *r, Ref *cp, Fn *fn) +subst(Ref *r, Ref *cp) { - if (rtype(*r) == RTmp && req(copyof(*r, cp), R)) - err("temporary %%%s is ill-defined", - fn->tmp[r->val].name); + assert((rtype(*r) != RTmp || !req(copyof(*r, cp), R)) && "ssa invariant broken"); *r = copyof(*r, cp); } @@ -121,7 +119,7 @@ copy(Fn *fn) continue; } for (a=0; anarg; a++) - subst(&p->arg[a], cp, fn); + subst(&p->arg[a], cp); pp=&p->link; } for (i=b->ins; i-b->ins < b->nins; i++) { @@ -131,9 +129,9 @@ copy(Fn *fn) continue; } for (a=0; a<2; a++) - subst(&i->arg[a], cp, fn); + subst(&i->arg[a], cp); } - subst(&b->jmp.arg, cp, fn); + subst(&b->jmp.arg, cp); } if (debug['C']) { fprintf(stderr, "\n> Copy information:"); -- cgit 1.4.1