emscripten-core / emscripten-core/emscripten
Assertion hit with simd128 + wasm=2 + safe_heap=1 combo
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
With a simple C++ hello world test file (or even just `int main(){}`), using `-msimd128`, `-sWASM=2` and `-sSAFE_HEAP` options together fails by hitting assertion in `AlignmentLowering.cpp`.
By removing any of those flags, or changing to `-sWASM=1`, the error goes away.
**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.21 (f9e81472f1ce541eddece1d27c3632e148e9031a)
clang version 16.0.0 (https://github.com/llvm/llvm-project a4a29438f451370ed241dde30bfcaab0fdf2ab71)
Target: wasm32-unknown-emscripten
Thread model: posix
```
**Failing command line in full:**
```
D:\Some\Path>em++.bat -msimd128 -sWASM=2 -sSAFE_HEAP=1 .cpp -o .html
unhandled unaligned load
UNREACHABLE executed at C:\b\s\w\ir\cache\builder\emscripten-releases\binaryen\src\passes\AlignmentLowering.cpp:259!
em++: error: 'D:/SomePath/emsdk/upstream\bin\wasm2js --emscripten .wasm --mvp-features --enable-simd' failed (returned 3221226505)
```
Contributor guide
Assessment
This issue has not been assessed yet.