<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Returning i24 results in "UNREACHABLE executed""
   href="https://bugs.llvm.org/show_bug.cgi?id=36564">36564</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Returning i24 results in "UNREACHABLE executed"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dan433584@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If this IR is compiled:


target triple = "wasm32-unknown-unknown-wasm"

define hidden i24 @foo() {
  ret i24 0
}



with 

    llc foo.ll -O0 -filetype=obj

then it will yield:

unexpected return type
UNREACHABLE executed at
/home/alex/code/rust4/src/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp:252!
LLVMSymbolizer: error reading file: No such file or directory
#0 0x00007fbe4488f45a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x96d45a)
#1 0x00007fbe4488d1fe llvm::sys::RunSignalHandlers()
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x96b1fe)
#2 0x00007fbe4488d372 SignalHandler(int)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x96b372)
#3 0x00007fbe4380b4b0 (/lib/x86_64-linux-gnu/libc.so.6+0x354b0)
#4 0x00007fbe4380b428 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
#5 0x00007fbe4380d02a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3702a)
#6 0x00007fbe4480dfca
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x8ebfca)
#7 0x00007fbe4664a8a4 PlaceMarkers(llvm::MachineFunction&,
llvm::MachineLoopInfo const&, llvm::WebAssemblyInstrInfo const&,
llvm::MachineDominatorTree&, llvm::WebAssemblyFunctionInfo&) [clone
.constprop.103]
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x27288a4)
#8 0x00007fbe4664ad93 (anonymous
namespace)::WebAssemblyCFGStackify::runOnMachineFunction(llvm::MachineFunction&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0x2728d93)
#9 0x00007fbe44b8f515 llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0xc6d515)
#10 0x00007fbe44994473 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0xa72473)
#11 0x00007fbe4499453c llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0xa7253c)
#12 0x00007fbe44993fdd llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/alex/code/rust4/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/libLLVM-6.0.so+0xa71fdd)
#13 0x000000000041924f (llc+0x41924f)
#14 0x000000000040c10d (llc+0x40c10d)
#15 0x00007fbe437f6830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#16 0x000000000040c2c9 (llc+0x40c2c9)
Stack dump:
0.      Program arguments: llc bugpoint-reduced-simplified.ll -filetype=obj -O0 
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.ll'.
2.      Running pass 'WebAssembly CFG Stackify' on function '@foo'
zsh: abort (core dumped)  llc bugpoint-reduced-simplified.ll -filetype=obj -O0





This is reduced from a Rust crate, and I'm not actually really sure how an i24
is coming out of rustc (this was in debug mode), but changing the optimization
level with `llc` fixes the issue so I figured it'd be good to report a bug!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>