https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84436
Romain Geissler <romain.geissler at amadeus dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |romain.geissler at amadeus dot com --- Comment #10 from Romain Geissler <romain.geissler at amadeus dot com> --- Hi, FYI, I bisected this revision r265463 to introduce a regression when building the llvm toolchain. If you do the following: - build gcc 9 >= r265463 (including recent revisions from late December) - build clang 7 or clang 8 svn with this gcc 9 (it will work) - finally with the resulting clang, build llvm's compiler-rt then clang itself will ICE. Before r265463 it was not the case, and considering the nature of the fix (missed optimization) I suspect more a gcc bug rather than a clang one. The exact clang failure is: FAILED: CMakeFiles/clang_rt.builtins-x86_64.dir/divtc3.c.o /workdir/build/final-system/llvm-build/./bin/clang --target=x86_64-1a-linux-gnu -DVISIBILITY_HIDDEN -O2 -mmmx -msse -msse2 -msse3 -I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include -I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include/ncursesw -O3 -DNDEBUG -m64 -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT CMakeFiles/clang_rt.builtins-x86_64.dir/divtc3.c.o -MF CMakeFiles/clang_rt.builtins-x86_64.dir/divtc3.c.o.d -o CMakeFiles/clang_rt.builtins-x86_64.dir/divtc3.c.o -c /workdir/src/llvm-8.0.0/compiler-rt/lib/builtins/divtc3.c fatal error: error in backend: Cannot select: 0x1a4b558: ch = fsqrt 0x199e868, 0x1a46e38, FrameIndex:i64<0> 0x1a46e38: f80,ch = CopyFromReg 0x199e868, Register:f80 %0 0x1a46d68: f80 = Register %0 0x1a4bd10: i64 = FrameIndex<0> In function: __divtc3 clang-8: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 8.0.0 Target: x86_64-1a-linux-gnu Thread model: posix InstalledDir: /workdir/build/final-system/llvm-build/./bin clang-8: 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-8: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-8: note: diagnostic msg: /tmp/divtc3-106b93.c clang-8: note: diagnostic msg: /tmp/divtc3-106b93.sh clang-8: note: diagnostic msg: Note: step 2 and 3 (build clang then build compiler-rt with the resulting clang) is done automatically when bootstrapping a 2-stage PGO clang using this cmake configuration: https://github.com/llvm-mirror/clang/blob/master/cmake/caches/PGO.cmake I don't know how to help more in investigating this regression. If I can do something, please ask. Cheers, Romain