summary refs log tree commit diff
path: root/lisc/isel.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-11 20:42:29 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:31 -0400
commit79c3d8968b7c2a7b450455a79b60562c9f436ea3 (patch)
tree7cdcce5368d03438cd58bcd4e0be822f9aa017be /lisc/isel.c
parent7ce4d334e54433f7e67d91baa9edb25adb26975b (diff)
downloadroux-79c3d8968b7c2a7b450455a79b60562c9f436ea3.tar.gz
fail on constant comparisons
In the future they will be eliminated by
constant propagation.
Diffstat (limited to 'lisc/isel.c')
-rw-r--r--lisc/isel.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index 7670eff..260c32b 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -72,22 +72,16 @@ static void
 selcmp(Ref arg[2], Fn *fn)
 {
 	Ref r;
-	int con, lng;
+	int lng;
 
-	con = 0;
 	if (rtype(arg[0]) == RCon) {
 		r = arg[1];
 		arg[1] = arg[0];
 		arg[0] = r;
-		if (rtype(r) == RCon) {
-			con = 1;
-			arg[0] = newtmp(TWord, fn);
-		}
+		assert(rtype(r) != RCon);
 	}
 	lng = islong(arg[0], fn) || islong(arg[1], fn);
 	emit(lng ? OXCmpl : OXCmpw, R, arg[1], arg[0]);
-	if (con)
-		emit(OCopy, arg[0], r, R);
 	r = arg[0];
 	if (lng && rtype(r) == RCon && noimm(r, fn)) {
 		curi->arg[0] = newtmp(TLong, fn);