Skip to content

[erlc] miscompilation of pattern that can return either 0.0 or -0.0 #7168

Closed
@RobinMorisset

Description

@RobinMorisset

Describe the bug
The following code:

f(_V0, _V0) ->
    -0.0;
f(_, _) ->
    0.0.

wrapper() ->
    io:write(f(ok, [])).

prints -0.0 whereas I would expect 0.0

Affected versions

Additional context
Compiling the code with +no_fold +no_ssa_opt makes it print 0.0 as expected.

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions