Bug 232866 - Compiler Incorrect Optimization
Summary: Compiler Incorrect Optimization
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-08 22:19 PST by zhiyi
Modified: 2021-11-15 22:20 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhiyi 2021-11-08 22:19:52 PST
OS: ubuntu20.04
Architecture: <x64>

./jsc bug.js

expected output
-NaN
-NaN

actual output
-NaN
NaN


bug.js
##################################
function f() {
    const v1 = Math.ceil({});
    const v2 = -v1;
    const v3 = v2.toLocaleString();
    return v3;
}
let a0 = f();
print(a0);

for (let i = 0; i < 0x1000; i++) { f(); }
let a3 = f();
print(a3);
Comment 1 Radar WebKit Bug Importer 2021-11-15 22:20:24 PST
<rdar://problem/85443513>