Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005513OCamlOCaml backend (code generation)public2012-02-23 11:522013-08-31 12:48
Reportercyocum 
Assigned Toxleroy 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformGNU/LinuxOSXUbuntuOS Version11.10
Product Version3.12.1 
Target VersionFixed in Version3.13.0+dev 
Summary0005513: Int64.div causes floating point exception
DescriptionThe 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 Reproducelet a = -9223372036854775808L
let b = -1L
let c = Int64.div a b

let _ = ()
TagsNo tags attached.
Attached Files

- Relationships
related to 0004740closedxleroy Int32.rem floating point exception 

-  Notes
(0006957)
xleroy (administrator)
2012-02-23 16:07

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 PR#4740) but not the native-code compiler.

(0006966)
xleroy (administrator)
2012-02-24 11:14

Fixed in SVN trunk, commit 12187.

- Issue History
Date Modified Username Field Change
2012-02-23 11:52 cyocum New Issue
2012-02-23 15:58 xleroy Relationship added related to 0004740
2012-02-23 16:07 xleroy Note Added: 0006957
2012-02-23 16:07 xleroy Assigned To => xleroy
2012-02-23 16:07 xleroy Status new => assigned
2012-02-23 16:07 xleroy Category OCaml runtime system => OCaml backend (code generation)
2012-02-24 11:14 xleroy Note Added: 0006966
2012-02-24 11:14 xleroy Status assigned => resolved
2012-02-24 11:14 xleroy Resolution open => fixed
2012-02-24 11:14 xleroy Fixed in Version => 3.13.0+dev
2013-08-31 12:48 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker