Bug 232869 - 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-09 01:55 PST by zhiyi
Modified: 2021-11-16 01:56 PST (History)
4 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-09 01:55:17 PST
OS: ubuntu20.04
Architecture: <x64>

./jsc bug.js

expected output
3
3

actual output
3
-1


bug.js
##################################
function f() {
    let v0 = 2147483648;
    const v1 = v0--;
    const v2 = new Float32Array([111,222,333,v1]);
    const v3 = v2.indexOf(v0);
    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-16 01:56:18 PST
<rdar://problem/85449162>