https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66785
Bug ID: 66785 Summary: internal compiler error in record_operand_use Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: chris_s_jones at yahoo dot com Target Milestone: --- Created attachment 35920 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35920&action=edit Source file to repro error Using GCC from a recent trunk checkout (rev 225476), I am seeing the following error on a simple input file. I'm using an ARM AArch64 cross-compiler running on a x86_64 host, though I'm unsure if that makes a difference for this case. Both -O3 and -funroll-loops are required to hit the error. % aarch64-linux-gnu-gcc -c -o place_test.o -O3 -mcpu=cortex-a57 -march=armv8-a -funroll-loops place_test.c place_test.c: In function 'place_and_route': place_test.c:23:1: internal compiler error: in record_operand_use, at regrename.c:215 } ^ 0xabc68d record_operand_use /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/regrename.c:215 0xabcf74 scan_rtx_reg /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/regrename.c:1130 0xabe9ec build_def_use /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/regrename.c:1710 0xabe9ec regrename_analyze(bitmap_head*) /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/regrename.c:726 0xe5dd12 func_fma_steering::execute_fma_steering() /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/config/aarch64/cortex-a57-fma-steering.c:1034 0xe5e85d pass_fma_steering::execute(function*) /local/chrisj/cd110/dev/cpu/tools/compiler/gcc/gcc-trunk/gcc/config/aarch64/cortex-a57-fma-steering.c:1071 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. The function is simple (full file attached) after being pruned as much as possible. void place_and_route (int num_regions) { int i, j; float capacity; for (i=0;i<num_regions;i++) { for (j=0;j<num_regions;j++) { place_region_y[i][j].capacity = capacity; place_region_y[i][j].inv_capacity = 1. / capacity; place_region_y[i][j].occupancy = 0.; place_region_y[i][j].cost = 0.; } } } Setting 'capacity' to a known non-zero value also makes the ICE go away. Explicitly setting it to zero results in the same error and eliminates the obvious -Wunused-value warning. Output of gcc -v (paths trimmed) Using built-in specs. COLLECT_GCC=/gcc-aarch64-225476/bin/aarch64-linux-gnu-gcc COLLECT_LTO_WRAPPER=/gcc-aarch64-225476/libexec/gcc/aarch64-linux-gnu/6.0.0/lto-wrapper Target: aarch64-linux-gnu Configured with: /gcc-trunk/configure CC=/gcc-x86/4.8.1/bin/gcc CXX=/gcc-x86/4.8.1/r0/bin/g++ LDFLAGS=-Wl,-rpath,/gcc-aarch64-225476/lib,-rpath,/gcc-x86/4.8.1/x86_64/lib64 'CFLAGS_FOR_TARGET=-march=armv8-a -mcpu=cortex-a57 -O3' 'CXXFLAGS_FOR_TARGET=-march=armv8-a -mcpu=cortex-a57 -O3' --prefix=/gcc-aarch64-225476 --target=aarch64-linux-gnu --with-sysroot=/gcc-aarch64-225476/sysroot --with-gmp=/gcc-aarch64-225476 --with-mpc=/gcc-aarch64-225476 --with-mpfr=/gcc-aarch64-225476 --with-isl=/gcc-aarch64-225476 --enable-__cxa_atexit --with-gnu-as --with-gnu-ld --enable-shared --disable-libssp --disable-libmudflap --enable-languages=c,c++,fortran --disable-libsanitizer --disable-nls Thread model: posix gcc version 6.0.0 20150706 (experimental) (GCC)