Compilation with IBM XL crashes the compiler
I was trying to build google benchmark with IBM XL 16.1.1 and it crashed the compiler. Not sure if anyone wants to investigate a workaround or so.
cmake -DCMAKE_CXX_COMPILER=xlc++ -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../
....
....
....
[ 40%] Building CXX object test/CMakeFiles/donotoptimize_test.dir/donotoptimize_test.cc.o
cd /ascldap/users/crtrott/Software/benchmark/build-xl/test && /ascldap/users/projects/ppc64le/ibm/xlC/16.1.1/bin/xlc++ -+ -DHAVE_POSIX_REGEX -DHAVE_STEADY_CLOCK -DTEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS -I/ascldap/users/crtrott/Software/benchmark/include -I/ascldap/users/crtrott/Software/benchmark/src/../include -qthreaded -std=c++11 -Wall -Wextra -Wshadow -pedantic -pedantic-errors -Wshorten-64-to-32 -fstrict-aliasing -Wno-deprecated-declarations -Wstrict-aliasing -Wthread-safety -UNDEBUG -O3 -o CMakeFiles/donotoptimize_test.dir/donotoptimize_test.cc.o -c /ascldap/users/crtrott/Software/benchmark/test/donotoptimize_test.cc
1500-004: (U) INTERNAL COMPILER ERROR while compiling main. Compilation ended. Contact your Service Representative and provide the following information: Internal abort.
xlc++ --version
IBM XL C/C++ for Linux, V16.1.1 (5725-C73, 5765-J13)
Version: 16.01.0001.0004
In the end this is clearly a compiler bug since it at least shouldn't crash. But we have been working around compiler bugs in our codes not sure what googles philosophy on this is.
Forgot to paste system info this is a IBM Power 9 system with NVIDIA V100 GPUs in it running ReadHat 7.5. (kinda like Summit). I can't post to much more details unfortunately but here is uname output:
Linux XXXX 4.14.0-49.8.1.el7a.ppc64le #1 SMP Mon May 28 07:06:43 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux
```
I don't have a system on which i can recreate this, but i'm definitely open to understanding why it crashes the compiler and what the workaround might be.
My guess is that it's the BitRef struct as we've seen problems with that before on GCC and Clang. Perhaps you could try (if you don't mind) commenting out lines 49-51 of donotoptimize_test.cc to see if that helps.
It crashes even in the firs DoNotOptimize. If one defines BENCHMARK_HAS_NO_INLINE_ASSEMBLY in benchmark.h the problem goes away. So probably that should be defined for IBM XL. Trying to see what the correct define to look for is later today.