Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 8f1c9c090dfbdf6e1de38ed34c1f028a2efbe8b0..6bd5ebf23b1e320f818fb3cddd06f85d1fd67a41 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -1413,7 +1413,11 @@ void LCodeGen::DoDivI(LDivI* instr) { |
} |
// Check for (kMinInt / -1). |
- if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
+ if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow) && |
+ (!CpuFeatures::IsSupported(SUDIV) || |
+ !instr->hydrogen()->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { |
+ // We don't need to check for overflow when truncating with sdiv |
+ // support because, on ARM, sdiv kMinInt, -1 -> kMinInt. |
Label left_not_min_int; |
__ cmp(left, Operand(kMinInt)); |
__ b(ne, &left_not_min_int); |