From 79c3d8968b7c2a7b450455a79b60562c9f436ea3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 11 Aug 2015 20:42:29 -0400 Subject: fail on constant comparisons In the future they will be eliminated by constant propagation. --- lisc/isel.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lisc/isel.c') 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); -- cgit 1.4.1