<p dir="auto">Running <code class="notranslate">/opt/julia-1.0.2/bin/julia --output-o sys-all.o --sysimage /opt/julia-1.0.2/lib/julia/sys.so --startup-file=no --compile=all --eval nothing found 39977 uncompiled methods for compile-all</code> causes segemtation fault:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="found 39977 uncompiled methods for compile-all
 11659 / 39977
signal (11): Segmentation fault
in expression starting at no file:0
jl_is_type_type at /buildworker/worker/package_linux64/build/src/julia.h:1058 [inlined]
emit_llvmcall at /buildworker/worker/package_linux64/build/src/ccall.cpp:977
emit_intrinsic at /buildworker/worker/package_linux64/build/src/intrinsics.cpp:921
emit_call at /buildworker/worker/package_linux64/build/src/codegen.cpp:3134
emit_expr at /buildworker/worker/package_linux64/build/src/codegen.cpp:3902
emit_ssaval_assign at /buildworker/worker/package_linux64/build/src/codegen.cpp:3615
emit_stmtpos at /buildworker/worker/package_linux64/build/src/codegen.cpp:3801 [inlined]
emit_function at /buildworker/worker/package_linux64/build/src/codegen.cpp:6254
jl_compile_linfo at /buildworker/worker/package_linux64/build/src/codegen.cpp:1159
_compile_all_deq at /buildworker/worker/package_linux64/build/src/precompile.c:262 [inlined]
jl_compile_all_defs at /buildworker/worker/package_linux64/build/src/precompile.c:303
jl_precompile at /buildworker/worker/package_linux64/build/src/precompile.c:365 [inlined]
jl_write_compiler_output at /buildworker/worker/package_linux64/build/src/precompile.c:34
jl_atexit_hook at /buildworker/worker/package_linux64/build/src/init.c:233
main at /buildworker/worker/package_linux64/build/ui/repl.c:234
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /opt/julia-1.0.2/bin/julia (unknown line)
Allocations: 1254722 (Pool: 1254268; Big: 454); GC: 2
Segmentation fault"><pre class="notranslate"><code class="notranslate">found 39977 uncompiled methods for compile-all
 11659 / 39977
signal (11): Segmentation fault
in expression starting at no file:0
jl_is_type_type at /buildworker/worker/package_linux64/build/src/julia.h:1058 [inlined]
emit_llvmcall at /buildworker/worker/package_linux64/build/src/ccall.cpp:977
emit_intrinsic at /buildworker/worker/package_linux64/build/src/intrinsics.cpp:921
emit_call at /buildworker/worker/package_linux64/build/src/codegen.cpp:3134
emit_expr at /buildworker/worker/package_linux64/build/src/codegen.cpp:3902
emit_ssaval_assign at /buildworker/worker/package_linux64/build/src/codegen.cpp:3615
emit_stmtpos at /buildworker/worker/package_linux64/build/src/codegen.cpp:3801 [inlined]
emit_function at /buildworker/worker/package_linux64/build/src/codegen.cpp:6254
jl_compile_linfo at /buildworker/worker/package_linux64/build/src/codegen.cpp:1159
_compile_all_deq at /buildworker/worker/package_linux64/build/src/precompile.c:262 [inlined]
jl_compile_all_defs at /buildworker/worker/package_linux64/build/src/precompile.c:303
jl_precompile at /buildworker/worker/package_linux64/build/src/precompile.c:365 [inlined]
jl_write_compiler_output at /buildworker/worker/package_linux64/build/src/precompile.c:34
jl_atexit_hook at /buildworker/worker/package_linux64/build/src/init.c:233
main at /buildworker/worker/package_linux64/build/ui/repl.c:234
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /opt/julia-1.0.2/bin/julia (unknown line)
Allocations: 1254722 (Pool: 1254268; Big: 454); GC: 2
Segmentation fault
</code></pre></div>
<p dir="auto">I expect to get sys-all.so which then can be used for <code class="notranslate">cc -shared -o sys-all.so sys-all.o -ljulia</code>.</p>
<p dir="auto">It would be nice to have a <code class="notranslate">switch</code>-like statement, exploiting LLVM's built-in <a href="http://llvm.org/docs/LangRef.html#switch-instruction" rel="nofollow">switch instruction</a>, since this can greatly enhance performance of look-up tables (which are not uncommon in inner loops), compared to chains of <code class="notranslate">if-else</code> statements (or a <code class="notranslate">Dict</code> of functions).</p>
<p dir="auto">I feel like I've mentioned this to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JeffBezanson/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JeffBezanson">@JeffBezanson</a>, before, but can't find an issue for it.</p>