Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

singlepass crashes compiling fdiv + fcopysign #2159

Closed
nlewycky opened this issue Mar 2, 2021 · 1 comment · Fixed by #2391
Closed

singlepass crashes compiling fdiv + fcopysign #2159

nlewycky opened this issue Mar 2, 2021 · 1 comment · Fixed by #2391
Labels
bug Something isn't working 📦 lib-compiler-singlepass About wasmer-compiler-singlepass

Comments

@nlewycky
Copy link
Contributor

nlewycky commented Mar 2, 2021

Testcase:

(module
  (func (export "_start") (result f64)
    f64.const 0x0p+0 (;=0;)
    f64.const 0x0p+0 (;=0;)
    f64.const 0x0p+0 (;=0;)
    f64.div
    f64.copysign
  )
)

fails to build with singlepass:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', lib/compiler-singlepass/src/codegen_x64.rs:513:60

the relevant part of the backtrace is:

   4: wasmer_compiler_singlepass::codegen_x64::FuncGen::emit_relaxed_binop
             at /home/nicholas/wasmer/lib/compiler-singlepass/src/codegen_x64.rs:513:28
   5: wasmer_compiler_singlepass::codegen_x64::FuncGen::canonicalize_nan
             at /home/nicholas/wasmer/lib/compiler-singlepass/src/codegen_x64.rs:341:9
   6: wasmer_compiler_singlepass::codegen_x64::FuncGen::feed_operator
             at /home/nicholas/wasmer/lib/compiler-singlepass/src/codegen_x64.rs:3570:33
@nlewycky nlewycky added the bug Something isn't working label Mar 2, 2021
@nlewycky
Copy link
Contributor Author

Another testcase, this time with floor + copysign, also showing that it occurs with f32 as well as f64:

(module
  (func (export "_start") (result f32)
    f32.const 0x0p+0 (;=0;)
    f32.const 0x0p+0 (;=0;)
    f32.floor
    f32.copysign
  )
)

@Hywan Hywan added the 📦 lib-compiler-singlepass About wasmer-compiler-singlepass label Jun 7, 2021
bors bot added a commit that referenced this issue Jun 8, 2021
2391: Fix Singlepass issue #2347 r=Hywan a=chenyukang

# Description
Fix Singlepass compiler issue: #2347 

I'm not sure whether the unit test case added to a suitable file. 
Any better suggestion?
@syrusakbary 

Edit by @Hywan: Close #2347, close #2159.


Co-authored-by: yukang <[email protected]>
Co-authored-by: Yukang <[email protected]>
@bors bors bot closed this as completed in e6c8fcd Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-compiler-singlepass About wasmer-compiler-singlepass
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants