https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94488
Bug ID: 94488 Summary: [AArch64] ICE from OpenMP SIMD right shift of uint64_t Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: e...@coeus-group.com Target Milestone: --- Created attachment 48199 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48199&action=edit Test case On AArch64 with optimizations enabled (-O1 is enough), attempting to right-shift an unsigned 64-bit value in an OpenMP SIMD loop generates an internal compiler error. This happens on at least GCC 9 and 10, and I've tried it cross-compiling to AArch64 and natively (on a Raspberry Pi running Fedora 31 with gcc 9.3.1). I'm attaching a test case. Here is the full output from attempting to compile it with `aarch64-linux-gnu-gcc-10 -v -fopenmp-simd -O2 -c -o test.o srl.c`: Using built-in specs. COLLECT_GCC=aarch64-linux-gnu-gcc-10 Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 10-20200324-1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --without-target-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.0.1 20200324 (experimental) [master revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536] (Debian 10-20200324-1) COLLECT_GCC_OPTIONS='-v' '-fopenmp-simd' '-O2' '-c' '-o' 'test.o' '-mlittle-endian' '-mabi=lp64' /usr/lib/gcc-cross/aarch64-linux-gnu/10/cc1 -quiet -v -imultiarch aarch64-linux-gnu srl.c -quiet -dumpbase srl.c -mlittle-endian -mabi=lp64 -auxbase-strip test.o -O2 -version -fopenmp-simd -fasynchronous-unwind-tables -o /tmp/ccGROOBh.s GNU C17 (Debian 10-20200324-1) version 10.0.1 20200324 (experimental) [master revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536] (aarch64-linux-gnu) compiled by GNU C version 10.0.1 20200324 (experimental) [master revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536], GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/local/include/aarch64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc-cross/aarch64-linux-gnu/10/include-fixed" ignoring nonexistent directory "/usr/include/aarch64-linux-gnu" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc-cross/aarch64-linux-gnu/10/include /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/include /usr/include End of search list. GNU C17 (Debian 10-20200324-1) version 10.0.1 20200324 (experimental) [master revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536] (aarch64-linux-gnu) compiled by GNU C version 10.0.1 20200324 (experimental) [master revision 596c90d3559:023579257f5:906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536], GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: b59507ef9cd435e859f115f5f55f1a57 during RTL pass: expand srl.c: In function ālā: srl.c:14:15: internal compiler error: in expand_shift_1, at expmed.c:2654 14 | aj.e[i] = ak.e[i] >> k; | ~~~~~~~~^~~~~~~~~~~~~~ 0x613d01 expand_shift_1 ../../src/gcc/expmed.c:2654 0x83dce5 expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*, rtx_def*, int) ../../src/gcc/expmed.c:2695 0x85053b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) ../../src/gcc/expr.c:9477 0x85725d expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:10049 0x864dc1 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:8353 0x864dc1 expand_normal ../../src/gcc/expr.h:288 0x864dc1 store_field ../../src/gcc/expr.c:7097 0x86178e expand_assignment(tree_node*, tree_node*, bool) ../../src/gcc/expr.c:5369 0x75c908 expand_gimple_stmt_1 ../../src/gcc/cfgexpand.c:3749 0x75c908 expand_gimple_stmt ../../src/gcc/cfgexpand.c:3847 0x7627ea expand_gimple_basic_block ../../src/gcc/cfgexpand.c:5887 0x7627ea execute ../../src/gcc/cfgexpand.c:6542 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.