8000 [vm] Floating point discrepancy (-0.0 vs +0.0) between `-emu_flavor emu` and `-emu_flavor jit` · Issue #6717 · erlang/otp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[vm] Floating point discrepancy (-0.0 vs +0.0) between -emu_flavor emu and -emu_flavor jit #6717
Closed
@RobinMorisset

Description

@RobinMorisset

Describe the bug
On the following code:

-module(jit13564).
-compile([export_all]).

f(0) ->
    -f(ok);
f(_) ->
    0 / 18446744073709551615.

wrapper0() ->
    io:write(f(0)).

Running it with cerl -emu_flavor emu -noshell -pa . -s jit13564 wrapper0 -s init stop results in -0.0 (which seems correct to me).
But running it with cerl -emu_flavor jit -noshell -pa . -s jit13564 wrapper0 -s init stop results in 0.0.

Expected behavior
I'd expect to get the same result from arithmetic operations regardless of whether the JIT is active or not.

Affected versions

Additional context
Replacing f by

f(0) ->
    f(ok);
f(_) ->
    - (0 / 18446744073709551615).

makes the program return -0.0 in both emu and jit flavors.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0