Segmentation fault when using llc to target riscv.

I am using LLVM version 4.0.1

Running llc -march=riscv64 math.ll returns:

#0 0x0000000000fed7d1 (llc+0xfed7d1)
#1 0x0000000000fec559 (llc+0xfec559)
#2 0x0000000000fec8d9 (llc+0xfec8d9)
#3 0x00007f22c044e5e0 __restore_rt (/lib64/
#4 0x0000000000d7faf3 (llc+0xd7faf3)
#5 0x0000000000cd4b88 (llc+0xcd4b88)
#6 0x0000000000cd530c (llc+0xcd530c)
#7 0x00000000006858c3 (llc+0x6858c3)
#8 0x000000000063c442 (llc+0x63c442)
#9 0x00007f22bf031c05 __libc_start_main (/lib64/
#10 0x000000000067f08a (llc+0x67f08a)
Stack dump:
0. Program arguments: llc -march=riscv32 math.ll
Segmentation fault (core dumped)

It works fine when I use any other argument for -march (x86, arm, arm64).

LLVM 6.0 is out, why not try to latest one?

Hi Ahmed,

Sorry for missing this post earlier. If you're interested in
experimenting with the current state of RISC-V support in LLVM I'd
strongly recommend building using LLVM HEAD. Note that RISC-V is still
an 'experimental' backend
(, though we
hope to pursue its promotion to 'official' prior to LLVM 7.0
branching. I intend to start that conversation within a month from