aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-08-03 17:42:22 -0700
committerRoy Frostig <[email protected]>2010-08-03 17:42:22 -0700
commit7b91933eed28c5b4dee2fc96cd903395247d63d1 (patch)
treebe109178bd81da02132bd93c548adada8b6b9691
parentFix some naughtiness of handling newlines in bracequotes and multi-line comme... (diff)
downloadrust-7b91933eed28c5b4dee2fc96cd903395247d63d1.tar.xz
rust-7b91933eed28c5b4dee2fc96cd903395247d63d1.zip
Avoid mem cmp mem in trans even though it's an X86ism becase we don't always catch it later on.
-rw-r--r--src/boot/me/trans.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index 813b9065..faa39442 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -625,7 +625,17 @@ let trans_visitor
let op_b = sub_sz b in
let tmp = next_vreg_cell word_sty in
mov tmp op_a;
- emit (Il.cmp op_a op_b);
+ (*
+ * FIXME: X86-ism going via a vreg; mem op= mem doesn't
+ * work and IL lacks sufficient brains to cope just now.
+ * Instead, should be
+ *
+ * emit (Il.cmp op_a op_b)
+ *
+ * Luckily this isn't the worst hack since we already
+ * needed a tmp vreg for op_a.
+ *)
+ emit (Il.cmp (Il.Cell tmp) op_b);
let jmp = mark () in
emit (Il.jmp Il.JAE Il.CodeNone);
mov tmp op_b;