summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-12 12:05:26 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-12 12:06:51 -0400
commitc416da5a70c4c7f43f44091b078251aa06be75d5 (patch)
treecfd3d11abd637f20b9ee04a0650c8a3f02f13001
parent6b1b97c996d04ea74df6f352ba0c3c19a9afdacf (diff)
downloadroux-c416da5a70c4c7f43f44091b078251aa06be75d5.tar.gz
handle dumb conditional jumps in isel
I also removed the code to handle jumps with a
constant argument since those should be eliminated
by the folding pass.
-rw-r--r--isel.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/isel.c b/isel.c
index f20efb0..80a3e6c 100644
--- a/isel.c
+++ b/isel.c
@@ -360,11 +360,9 @@ seljmp(Blk *b, Fn *fn)
 	assert(b->jmp.type == JJnz);
 	r = b->jmp.arg;
 	b->jmp.arg = R;
-	assert(!req(r, R));
-	if (rtype(r) == RCon) {
+	assert(!req(r, R) && rtype(r) != RCon);
+	if (b->s1 == b->s2) {
 		b->jmp.type = JJmp;
-		if (req(r, CON_Z))
-			b->s1 = b->s2;
 		b->s2 = 0;
 		return;
 	}