Int64.div causes floating point exception #5513
Original bug ID: 5513
The code attached compiles. However, when run, it causes a Floating Point exception when it shouldn't. This happens on both 3.12.0 and a compiled 3.12.1 system on XUbuntu.
Steps to reproduce
let a = -9223372036854775808L
let _ = ()
Comment author: @xavierleroy
I gather this is observed with ocamlopt on an x86-64 platform. The x86 "idiv" instruction unhelpfully raises a division error when computing min_int / -1 instead of returning min_int as we want. The bytecode interpreter and the runtime system were hardened against this behavior (see #4740) but not the native-code compiler.