Index: runtime/vm/intermediate_language.cc |
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
index 4d781eb5b752ae4f7831761efd799a0690177aad..0b5f48ed37ddae3458a12351e93b897dbc115213 100644 |
--- a/runtime/vm/intermediate_language.cc |
+++ b/runtime/vm/intermediate_language.cc |
@@ -2310,6 +2310,11 @@ Definition* UnboxedIntConverterInstr::Canonicalize(FlowGraph* flow_graph) { |
value()->definition()->AsUnboxedIntConverter(); |
if ((box_defn != NULL) && (box_defn->representation() == from())) { |
if (box_defn->from() == to()) { |
+ // Do not erase truncating convertions from 64-bit value to 32-bit values |
+ // because such convertions erase upper 32 bits. |
+ if ((box_defn->from() == kUnboxedMint) && box_defn->is_truncating()) { |
+ return this; |
+ } |
return box_defn->value()->definition(); |
} |