From 6464ec389e2da17b1674858858406e211b16e5f6 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 23 Nov 2025 21:54:40 +0100 Subject: ir: implement cvtu64f. and other bug fixes compiler is bootstrapping?! however, stage1 and stage2+ executables aren't bit-identical.. small differences in the codegen.. need to look into that --- c/c.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'c/c.c') diff --git a/c/c.c b/c/c.c index d609cd0..6d1996a 100644 --- a/c/c.c +++ b/c/c.c @@ -3051,11 +3051,14 @@ condexprrec(struct function *fn, const struct expr *ex, struct condphis *phis, condexprrec(fn, &ex->sub[2], phis, phityp, -1, end, end); } else { union ref r, val; + union type valty; if (!phis && (!next || next == end)) { expreffects(fn, ex); } else { val = r = exprvalue(fn, ex); + valty = ex->ty; if (boolcon >= 0) { + valty = mktype(TYBOOL); if (!next || next == end) { boolcon = -1; val = cvt(fn, mktype(TYBOOL), ex->ty, r); @@ -3066,7 +3069,7 @@ condexprrec(struct function *fn, const struct expr *ex, struct condphis *phis, } if (phis) { if (isscalar(phityp)) - val = cvt(fn, phityp, ex->ty, val); + val = cvt(fn, phityp, valty, val); else assert(ex->ty.bits == phityp.bits); vpush(&phis->ref, val); } -- cgit v1.2.3