SingleAccretion opened issue #10564:
Reproduction:
__attribute__((noinline)) int InvalidateRegisters() { volatile int x = 0; int r1 = -1; int r2 = -2; int r3 = -3; int r4 = -4; int r5 = -5; int r6 = -6; int r7 = -7; int r8 = -8; return r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8; } __attribute__((noinline)) int NoInlineSideEffect_1(int b, int c) { InvalidateRegisters(); volatile int x[3] = {1, 2, 3}; return x[(b + c) >> 16]; } __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) { int t = b & 431; NoInlineSideEffect_1(t, b); return 0; } int main() { volatile int x = 1; VariableLiveRangeStartIsCorrect(42); }> clang -O2 -g -o main.wasm main.cpp > lldb -o "b VariableLiveRangeStartIsCorrect" -o "r" -- wasmtime -Ddebug-info -Oopt-level=2 -Ccache=n main.wasm > (lldb) s > (lldb) vExpected result:
b = 42.
Actual result:Process 65804 stopped * thread #1, name = 'main', stop reason = step in frame #0: 0x000001b883d31113 JIT(0x1b883f01010)`VariableLiveRangeStartIsCorrect(b=-2082057552) at main.cpp:20:5 17 __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) 18 { 19 int t = b & 431; -> 20 NoInlineSideEffect_1(t, b); 21 return 0; 22 } 23 (lldb) v (WasmtimeVMContext *) __vmctx = 0x000001b883e652b0 (int) b = -2082057552 (int) t = <no location, value may have been optimized out>Cause: confusion over what the live range endpoints represent. See more notes https://github.com/bytecodealliance/wasmtime/issues/9716.
SingleAccretion edited issue #10564:
Reproduction:
__attribute__((noinline)) int InvalidateRegisters() { volatile int x = 0; int r1 = -1; int r2 = -2; int r3 = -3; int r4 = -4; int r5 = -5; int r6 = -6; int r7 = -7; int r8 = -8; return r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8; } __attribute__((noinline)) int NoInlineSideEffect_1(int b, int c) { InvalidateRegisters(); volatile int x[3] = {1, 2, 3}; return x[(b + c) >> 16]; } __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) { int t = b & 431; NoInlineSideEffect_1(t, b); return 0; } int main() { volatile int x = 1; VariableLiveRangeStartIsCorrect(42); }> clang -O2 -g -o main.wasm main.cpp > lldb -o "b VariableLiveRangeStartIsCorrect" -o "r" -- wasmtime -Ddebug-info -Oopt-level=2 -Ccache=n main.wasm > (lldb) s > (lldb) vExpected result:
b = 42.
Actual result:Process 65804 stopped * thread #1, name = 'main', stop reason = step in frame #0: 0x000001b883d31113 JIT(0x1b883f01010)`VariableLiveRangeStartIsCorrect(b=-2082057552) at main.cpp:20:5 17 __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) 18 { 19 int t = b & 431; -> 20 NoInlineSideEffect_1(t, b); 21 return 0; 22 } 23 (lldb) v (WasmtimeVMContext *) __vmctx = 0x000001b883e652b0 (int) b = -2082057552 (int) t = <no location, value may have been optimized out>Cause: confusion over what the live range endpoints represent. See more notes https://github.com/bytecodealliance/wasmtime/issues/9716.
Excerpt from the trace log:
|BB|Inst |IP |VL0 |VL4294967294| |--|-------|---|--------|------------| |B0|Inst 0 |33 | | | | | | |Inst 1 |36 | | | | | | |Inst 2 |51 |v194|p6i|v192|p7i | ; NoInlineSideEffect_1(t, b) | |Inst 3 |56 |* | |* |p13i | |B1|Inst 4 |56 |* | |* |p13i | | |Inst 5 |58 |* | |* |p13i | | |Inst 6 |58 |* | |* | | block0: movq %rdx, %rsi andl $0x1af, %edx movq %rsi, %rcx movq %rdi, %r13 movq %r13, %rsi call User(userextname0) ; NoInlineSideEffect_1(t, b) jmp label1
SingleAccretion edited issue #10564:
Reproduction:
__attribute__((noinline)) int InvalidateRegisters() { volatile int x = 0; int r1 = -1; int r2 = -2; int r3 = -3; int r4 = -4; int r5 = -5; int r6 = -6; int r7 = -7; int r8 = -8; return r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8; } __attribute__((noinline)) int NoInlineSideEffect_1(int b, int c) { InvalidateRegisters(); volatile int x[3] = {1, 2, 3}; return x[(b + c) >> 16]; } __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) { int t = b & 431; NoInlineSideEffect_1(t, b); return 0; } int main() { volatile int x = 1; VariableLiveRangeStartIsCorrect(42); }> clang -O2 -g -o main.wasm main.cpp > lldb -o "b VariableLiveRangeStartIsCorrect" -o "r" -- wasmtime -Ddebug-info -Oopt-level=2 -Ccache=n main.wasm > (lldb) s > (lldb) vExpected result:
b = 42.
Actual result:Process 65804 stopped * thread #1, name = 'main', stop reason = step in frame #0: 0x000001b883d31113 JIT(0x1b883f01010)`VariableLiveRangeStartIsCorrect(b=-2082057552) at main.cpp:20:5 17 __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) 18 { 19 int t = b & 431; -> 20 NoInlineSideEffect_1(t, b); 21 return 0; 22 } 23 (lldb) v (WasmtimeVMContext *) __vmctx = 0x000001b883e652b0 (int) b = -2082057552 (int) t = <no location, value may have been optimized out>Cause: confusion over what the live range endpoints represent. See more notes https://github.com/bytecodealliance/wasmtime/issues/9716.
Excerpt from the trace log:
|BB|Inst |IP |VL0 |VL4294967294| |--|-------|---|--------|------------| |B0|Inst 0 |33 | | | | | | |Inst 1 |36 | | | | | | |Inst 2 |51 |v194|p6i|v192|p7i | ; NoInlineSideEffect_1(t, b) | |Inst 3 |56 |* | |* |p13i | |B1|Inst 4 |56 |* | |* |p13i | | |Inst 5 |58 |* | |* |p13i | | |Inst 6 |58 |* | |* | | block0: movq %rdx, %rsi andl $0x1af, %edx ; Invalidates the value of p6i movq %rsi, %rcx movq %rdi, %r13 movq %r13, %rsi call User(userextname0) ; NoInlineSideEffect_1(t, b) jmp label1
SingleAccretion closed issue #10564:
Reproduction:
__attribute__((noinline)) int InvalidateRegisters() { volatile int x = 0; int r1 = -1; int r2 = -2; int r3 = -3; int r4 = -4; int r5 = -5; int r6 = -6; int r7 = -7; int r8 = -8; return r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8; } __attribute__((noinline)) int NoInlineSideEffect_1(int b, int c) { InvalidateRegisters(); volatile int x[3] = {1, 2, 3}; return x[(b + c) >> 16]; } __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) { int t = b & 431; NoInlineSideEffect_1(t, b); return 0; } int main() { volatile int x = 1; VariableLiveRangeStartIsCorrect(42); }> clang -O2 -g -o main.wasm main.cpp > lldb -o "b VariableLiveRangeStartIsCorrect" -o "r" -- wasmtime -Ddebug-info -Oopt-level=2 -Ccache=n main.wasm > (lldb) s > (lldb) vExpected result:
b = 42.
Actual result:Process 65804 stopped * thread #1, name = 'main', stop reason = step in frame #0: 0x000001b883d31113 JIT(0x1b883f01010)`VariableLiveRangeStartIsCorrect(b=-2082057552) at main.cpp:20:5 17 __attribute__((noinline)) int VariableLiveRangeStartIsCorrect(int b) 18 { 19 int t = b & 431; -> 20 NoInlineSideEffect_1(t, b); 21 return 0; 22 } 23 (lldb) v (WasmtimeVMContext *) __vmctx = 0x000001b883e652b0 (int) b = -2082057552 (int) t = <no location, value may have been optimized out>Cause: confusion over what the live range endpoints represent. See more notes https://github.com/bytecodealliance/wasmtime/issues/9716.
Excerpt from the trace log:
|BB|Inst |IP |VL0 |VL4294967294| |--|-------|---|--------|------------| |B0|Inst 0 |33 | | | | | | |Inst 1 |36 | | | | | | |Inst 2 |51 |v194|p6i|v192|p7i | ; NoInlineSideEffect_1(t, b) | |Inst 3 |56 |* | |* |p13i | |B1|Inst 4 |56 |* | |* |p13i | | |Inst 5 |58 |* | |* |p13i | | |Inst 6 |58 |* | |* | | block0: movq %rdx, %rsi andl $0x1af, %edx ; Invalidates the value of p6i movq %rsi, %rcx movq %rdi, %r13 movq %r13, %rsi call User(userextname0) ; NoInlineSideEffect_1(t, b) jmp label1
Last updated: Dec 06 2025 at 06:05 UTC