[llvm-bugs] [Bug 42498] New: Error: WebAssembly hasn't implemented computed gotos in Emscripten's latest-upstream llvm/trunk backend

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 3 08:28:19 PDT 2019


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

            Bug ID: 42498
           Summary: Error: WebAssembly hasn't implemented computed gotos
                    in Emscripten's latest-upstream llvm/trunk backend
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: rverschelde at gmail.com
                CC: llvm-bugs at lists.llvm.org

This might be a known issue as it's an unimplemented feature, but it might be
worth tracking here, especially as Emscripten is moving from their fastcomp
fork (which seems to support gotos) to llvm upstream/trunk (which apparently
does not).

When attempting to compile Godot Engine's master branch
(https://github.com/godotengine/godot) with latest Emscripten and its
latest-upstream llvm/trunk backend, the following error is raised:

---

modules/gdscript/gdscript_function.cpp:262:27: error: WebAssembly hasn't
implemented computed gotos
Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant
**p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state) {
                          ^
modules/gdscript/gdscript_function.cpp:262:27: error: WebAssembly hasn't
implemented computed gotos
fatal error: error in backend: Cannot select: t11: ch = brind t0, t10
  t10: i32,ch = load<(load 4 from %ir.indirect.goto.dest.in, !tbaa !58)> t0,
t12, undef:i32
    t12: i32 = add t8, t14
      t8: i32 = shl t5, Constant:i32<2>
        t5: i32,ch = load<(load 4 from %ir..pn.in, !tbaa !45)> t0, t2,
undef:i32
          t2: i32,ch = CopyFromReg t0, Register:i32 %1446
            t1: i32 = Register %1446
          t4: i32 = undef
        t7: i32 = Constant<2>
      t14: i32 = WebAssemblyISD::Wrapper TargetGlobalAddress:i32<[40 x i8*]*
@_ZZN16GDScriptFunction4callEP16GDScriptInstancePPK7VariantiRNS2_9CallErrorEPNS_9CallStateEE16switch_table_ops>
0
        t13: i32 = TargetGlobalAddress<[40 x i8*]*
@_ZZN16GDScriptFunction4callEP16GDScriptInstancePPK7VariantiRNS2_9CallErrorEPNS_9CallStateEE16switch_table_ops>
0
    t4: i32 = undef
In function:
_ZN16GDScriptFunction4callEP16GDScriptInstancePPK7VariantiRNS2_9CallErrorEPNS_9CallStateE
clang-9: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0
(/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project
039af0ea03f987654a162b6160399a00fd22b1b0)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/akien/Projects/godot/emscripten/emsdk/upstream/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/gdscript_function-d03862.cpp
clang-9: note: diagnostic msg: /tmp/gdscript_function-d03862.sh
clang-9: note: diagnostic msg: 

********************
shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting

---

See https://github.com/godotengine/godot/issues/30248 for details.
The files mentioned in the above error are included in that issue.

Steps to reproduce:
- Clone https://github.com/godotengine/godot
- Install Emscripten as per
https://emscripten.org/docs/getting_started/downloads.html, but use
`latest-upstream` instead of `latest` in the `./emsdk` commands
- Compile with `scons p=javascript target=release`

I haven't yet tried to make a minimal reproduction project as I'm not so
familiar with Emscripten, but I'll attempt it soon and post an update when I
do.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190703/20856411/attachment-0001.html>


More information about the llvm-bugs mailing list