OCamlPro / owi

WebAssembly Swissknife & cross-language bugfinder
https://ocamlpro.github.io/owi/
GNU Affero General Public License v3.0
136 stars 17 forks source link

Clang parsing error in testcomp #386

Closed filipeom closed 2 months ago

filipeom commented 2 months ago

With clang 16:

dune exec -- owi c bench/testcomp/sv-benchmarks/c/ldv-regression/test22-3.c 
[parse exception: bad local.get index (at 0:209)]
Fatal: error parsing wasm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
run ['/usr/bin/clang' '-O3' '--target=wasm32' '-m32' '-ffreestanding'
     '--no-standard-libraries' '-Wno-everything' '-flto=thin'
     '-Wl,--entry=main' '-Wl,--export=main' '-Wl,--lto-O0'
     '-Wl,-z,stack-size=8388608' '-I'
     '/home/filipe/lib/owi/_build/install/default/share/owi/libc' '-o'
     'a.out.wasm'
     '/home/filipe/lib/owi/_build/install/default/share/owi/binc/libc.wasm'
     'bench/testcomp/sv-benchmarks/c/ldv-regression/test22-3.c']: exited with 1%  

In results-testcomp-owi_w24_O3_sZ3-2024-07-17_00h31m16 this previously passed

filipeom commented 2 months ago

Compiling everything with -O0 seems to fix the parsing error, but:

dune exec -- owi c bench/testcomp/sv-benchmarks/c/ldv-regression/test22-3.c -O0
All OK%              
filipeom commented 2 months ago

Oh ok, it's because inlining _or in https://github.com/OCamlPro/owi/commit/da85f7bb8355982721846812b40ae6117274da8b uses locals that don't exist. #380 should close this

zapashcanon commented 2 months ago

Fixed by #388.