Open kraj opened 2 years ago
@llvm/issue-subscribers-backend-mips
a workaround for now is to disable musttail
attribute usage in grpcio-tools
I see that while compiling protobuf on MIPS64/OpenBSD too.
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/bin/c++ -B /usr/ports/pobj/protobuf-3.21.12/bin -DHAVE_CONFIG_H -I. -I/usr/ports/pobj/protobuf-3.21.12/protobuf-3.21.12/src -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -pipe -MT google/protobuf/generated_message_tctable_lite.lo -MD -MP -MF google/protobuf/.deps/generated_message_tctable_lite.Tpo -c /usr/ports/pobj/protobuf-3.21.12/protobuf-3.21.12/src/google/protobuf/generated_message_tctable_lite.cc -fPIC -DPIC -o google/protobuf/.libs/generated_message_tctable_lite.o
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '/usr/ports/pobj/protobuf-3.21.12/protobuf-3.21.12/src/google/protobuf/generated_message_tctable_lite.cc'.
4. Running pass 'MIPS DAG->DAG Pattern Instruction Selection' on function '@_ZN6google8protobuf8internal8TcParser9MiniParseEPNS0_11MessageLiteEPKcPNS1_12ParseContextEPKNS1_16TcParseTableBaseEyNS1_11TcFieldDataE'
c++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
OpenBSD clang version 13.0.0
Target: mips64-unknown-openbsd7.2
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/generated_message_tctable_lite-e5cce2.cpp
c++: note: diagnostic msg: /tmp/generated_message_tctable_lite-e5cce2.sh
c++: note: diagnostic msg:
********************
Error while executing c++ -DHAVE_CONFIG_H -I. -I/usr/ports/pobj/protobuf-3.21.12/protobuf-3.21.12/src -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -pipe -MT google/protobuf/generated_message_tctable_lite.lo -MD -MP -MF google/protobuf/.deps/generated_message_tctable_lite.Tpo -c /usr/ports/pobj/protobuf-3.21.12/protobuf-3.21.12/src/google/protobuf/generated_message_tctable_lite.cc -fPIC -DPIC -o google/protobuf/.libs/generated_message_tctable_lite.o
This can be worked around with -mllvm -mips-tail-calls=1
, which seems to enable tail call optimization for MIPS in Clang. It appears this option is off by default at all optimization levels, but it is unclear why.
clang crashed with the attached testcase from grpcio-tools on mips
generated_message_tctable_lite-9b6bf4.tar.gz