Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flambda optimizes away code that raises Division_by_zero #7328

Closed
vicuna opened this issue Aug 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Aug 17, 2016

Original bug ID: 7328
Reporter: @yallop
Assigned to: @chambart
Status: closed (set by @damiendoligez on 2016-10-26T15:03:00Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.04.0 +dev / +beta1 / +beta2
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: middle end (typedtree to clambda)

Bug description

Example:

$ cat div.ml
let _ = Int64.div 1L 0L in print_endline "done"

With flambda:

$ opam switch 4.04.0+beta1+flambda
# To setup the new switch in the current shell, you need to run:
eval `opam config env`
$ eval `opam config env`
$ ocamlopt div.ml && ./a.out
done

Without flambda:

$ opam switch 4.04.0+beta1
# To setup the new switch in the current shell, you need to run:
eval `opam config env`
$ eval `opam config env`
$ ocamlopt div.ml && ./a.out
Fatal error: exception Division_by_zero
@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 18, 2016

Comment author: @chambart

Pdivbint and Pmodbint are marked as 'No_effects' by Semantics_of_primitives.

I will add the fix to #702 as this needs the same handling.

@vicuna vicuna closed this Oct 26, 2016

@vicuna vicuna added the middle-end label Mar 14, 2019

@vicuna vicuna added this to the 4.05.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.