aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/12-flt.c5
-rw-r--r--x86_64/isel.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/test/12-flt.c b/test/12-flt.c
index 36f4e90..5077026 100644
--- a/test/12-flt.c
+++ b/test/12-flt.c
@@ -40,6 +40,11 @@ double nummod(double a, double b) {
return m;
}
+double branch(double a) {
+ if (a + 1.1) return 0.0;
+ return -a;
+}
+
int main() {
NAN/=0.0;
assert(_(1.0) < _(2.0));
diff --git a/x86_64/isel.c b/x86_64/isel.c
index 3a753e6..ded1a52 100644
--- a/x86_64/isel.c
+++ b/x86_64/isel.c
@@ -577,7 +577,7 @@ seljmp(struct function *fn, struct block *blk)
&& (oiscmp(instrtab[c.i].op) || instrtab[c.i].op == Oand || instrtab[c.i].op == Osub)) {
instrtab[c.i].keep = 1;
} else {
- if (!(opflags[instrtab[c.i].op] & ZF) || blk->ins.n == 0 || c.i != blk->ins.p[blk->ins.n - 1]) {
+ if (kisflt(instrtab[c.i].cls) || !(opflags[instrtab[c.i].op] & ZF) || blk->ins.n == 0 || c.i != blk->ins.p[blk->ins.n - 1]) {
struct instr *ins;
int curi = blk->ins.n;
blk->jmp.arg[0] = insertinstr(blk, blk->ins.n, mkinstr(Oneq, insrescls(instrtab[c.i]), c, ZEROREF));