Skip to content

Commit 7b91933

Browse files
committed
Avoid mem cmp mem in trans even though it's an X86ism becase we don't always catch it later on.
1 parent a1ecdb1 commit 7b91933

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/boot/me/trans.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,17 @@ let trans_visitor
625625
let op_b = sub_sz b in
626626
let tmp = next_vreg_cell word_sty in
627627
mov tmp op_a;
628-
emit (Il.cmp op_a op_b);
628+
(*
629+
* FIXME: X86-ism going via a vreg; mem op= mem doesn't
630+
* work and IL lacks sufficient brains to cope just now.
631+
* Instead, should be
632+
*
633+
* emit (Il.cmp op_a op_b)
634+
*
635+
* Luckily this isn't the worst hack since we already
636+
* needed a tmp vreg for op_a.
637+
*)
638+
emit (Il.cmp (Il.Cell tmp) op_b);
629639
let jmp = mark () in
630640
emit (Il.jmp Il.JAE Il.CodeNone);
631641
mov tmp op_b;

0 commit comments

Comments
 (0)