bergner@pike:~/gcc/BUGS/MMA$ cat ice3.i typedef unsigned char vec_t __attribute__((vector_size(16))); int foo (vec_t *rowA, vec_t *rowB, vec_t *dst) { __vector_quad acc0; __builtin_mma_xvf32gerpp (&acc0, rowB[0], rowA[0]); __builtin_mma_disassemble_acc (dst, &acc0); } bergner@pike:~/gcc/BUGS/MMA$ /home/bergner/gcc/build/gcc-fsf-mainline-mma-builtins-debug/gcc/xgcc -B/home/bergner/gcc/build/gcc-fsf-mainline-mma-builtins-debug/gcc -S -O2 -mcpu=power10 ice3.i during RTL pass: init-regs ice3.i: In function ‘foo’: ice3.i:8:1: internal compiler error: Segmentation fault 8 | } | ^ 0x113d6697 crash_signal /home/bergner/gcc/gcc-fsf-mainline-mma-builtins/gcc/toplev.c:327 0x10b436c4 emit_move_insn(rtx_def*, rtx_def*) /home/bergner/gcc/gcc-fsf-mainline-mma-builtins/gcc/expr.c:3821 0x1289319b initialize_uninitialized_regs /home/bergner/gcc/gcc-fsf-mainline-mma-builtins/gcc/init-regs.c:108 0x12893443 execute /home/bergner/gcc/gcc-fsf-mainline-mma-builtins/gcc/init-regs.c:156
Raji reported the above ICE/SEGV. This probably also affects GCC10. Mine.
The problem is caused by using an uninitialized __vector_quad (or __vector_pair) variable. In those cases, initialize_uninitialized_regs() detects that and emits an initialization via: emit_move_insn (reg, CONST0_RTX (GET_MODE (reg))); The problem is we don't have CONST0_RTX(mode) defined for opaque modes, so it returns NULL which leads to the ICE. I have a patch I'm testing to add that support.
The master branch has been updated by Peter Bergner <bergner@gcc.gnu.org>: https://gcc.gnu.org/g:a33927c9ab4af3f4595251ce0c8ba54db821b039 commit r11-7249-ga33927c9ab4af3f4595251ce0c8ba54db821b039 Author: Peter Bergner <bergner@linux.ibm.com> Date: Mon Feb 15 10:38:33 2021 -0600 rtl-optimization: Fix uninitialized use of opaque mode variable ICE [PR98872] The initialize_uninitialized_regs function emits (set (reg:) (CONST0_RTX)) for all uninitialized pseudo uses. However, some modes (eg, opaque modes) may not have a CONST0_RTX defined, leading to an ICE when we try and create the initialization insn. The fix is to skip emitting the initialization if there is no CONST0_RTX defined for the mode. 2021-02-15 Peter Bergner <bergner@linux.ibm.com> gcc/ PR rtl-optimization/98872 * init-regs.c (initialize_uninitialized_regs): Skip initialization if CONST0_RTX is NULL. gcc/testsuite/ PR rtl-optimization/98872 * gcc.target/powerpc/pr98872.c: New test.
Fixed. No backport needed.