qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 79c3d8968b7c2a7b450455a79b60562c9f436ea3
parent 7ce4d334e54433f7e67d91baa9edb25adb26975b
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Tue, 11 Aug 2015 20:42:29 -0400

fail on constant comparisons

In the future they will be eliminated by
constant propagation.

Diffstat:
Mlisc/isel.c | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git 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);