Closed b-s-a closed 4 years ago
Yeah this seems like a bug with at least Release Linux builds that I haven't tracked down yet.
Can I help you to fix the bug? I just build llvm with clang from your repository. I do not understand, how my Linux may influence on build results.
This bug does not happen with a Debug Linux build, but I can reproduce it with a Release Linux Build.
Interesting. I suggest run compilation under valgrind memcheck. But it is may be caused by UB in the code.
I have fixed this, will push soon.
I try to compile small function: $ ~/projects/llvm-project/build/bin/clang -target z180 -v -xc -S -o- - <<<'int main(void) { return 0; }' fatal error: error in backend: unable to legalize instruction: GSTORE %1:(s16), %0:_(p0) :: (store 2 into %ir.retval, align 1) (in function: main) clang-10: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 10.0.0 (https://github.com/b-s-a/llvm-project.git 040b525c8d7f148c892431cc12a85b4e9bdbf6f0)
More complex functions (for example { return x * y; } or CRC computation) cause same errors (instructions G_LOAD, G_PHI...).