https://bugs.llvm.org/show_bug.cgi?id=37546

            Bug ID: 37546
           Summary: wasm32: Invalid wasm file generated at O0 on call
                    signature
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedb...@nondot.org
          Reporter: a...@crichton.co
                CC: dan433...@gmail.com, llvm-bugs@lists.llvm.org,
                    s...@chromium.org

Created attachment 20328
  --> https://bugs.llvm.org/attachment.cgi?id=20328&action=edit
IR

Originally reported at https://github.com/rustwasm/wasm-bindgen/issues/199 this
bug then transitioned into https://github.com/rust-lang/rust/issues/50869 where
I've been able to reduce this a bit to hopefully be in a reportable state for
LLVM itself.

The attached IR, when run through `llc` at O0, will generate a wasm object file
which fails to pass `wasm-validate`:

    $ llc foo.ll -O0 -filetype=obj -o foo.o
    $ wasm-validate --enable-mutable-globals foo.o
--ignore-custom-section-errors
    tmp.o:0000b36: error: type mismatch in call, expected [i32, i32] but got
[i32]

I think this appears to be the root cause for causing the final linked module
to become invalid as well. Note that the attached IR is also reduced via
bugpoint so it may look a little odd. If there's any questions about this
though, please feel free to let me know!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to