https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122126
Bug ID: 122126
Summary: [14 - 16 regression] X86-64 AVX2 and PowerPC64LE:
crash at -O2/3
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xxs_chy at outlook dot com
Target Milestone: ---
Reproducer: https://godbolt.org/z/ecxbG57MG
Testcase:
#include <stdint.h>
#define BS_VEC(type, num) type __attribute__((vector_size(num * sizeof(type))))
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
int32_t g_98, func_54_LOCAL_CHECKSUM;
uint8_t func_54() {
BS_VEC(uint32, 4) BS_VAR_0;
for (;;) {
int l_183;
func_54_LOCAL_CHECKSUM ^= BS_VAR_0[0];
asm goto("" : : : : BS_LABEL_7);
for (; g_98;)
BS_LABEL_7:
BS_VAR_0[4 ? __builtin_convertvector((BS_VEC(uint16, 8)){},
BS_VEC(uint64, 8))[l_183]
? 0
: 690501320391798396
: 0] = 0;
for (; l_183;)
;
}
}
X86-64 command:
> x86_64-unknown-linux-gnu-gcc -mavx2 -O2 a.c
X86-64 output:
<source>: In function 'func_54':
<source>:23:1: error: unrecognizable insn:
23 | }
| ^
(insn 87 86 88 17 (set (reg:V4SI 128)
(vec_merge:V4SI (vec_duplicate:V4SI (reg:SI 129))
(reg:V4SI 128)
(const_int 1152921504606846976 [0x1000000000000000])))
"<source>":19:23 discrim 4 -1
(nil))
during RTL pass: vregs
<source>:23:1: internal compiler error: in extract_insn, at recog.cc:2812
0x1e71cec internal_error(char const*, ...)
???:0
0x749e39 fancy_abort(char const*, int, char const*)
???:0
0x71ff8d _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
???:0
0x71ffaf _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
PowerPC64 command:
> powerpc64le-unknown-linux-gnu-gcc -O2 a.c
PowerPC64 output:
during RTL pass: expand
<source>: In function 'func_54':
<source>:19:23: internal compiler error: Segmentation fault
15 | BS_VAR_0[4 ? __builtin_convertvector((BS_VEC(uint16, 8)){},
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 | BS_VEC(uint64, 8))[l_183]
| ~~~~~~~~~~~~~~~~~~~~~~~~~
17 | ? 0
| ~~~
18 | : 690501320391798396
| ~~~~~~~~~~~~~~~~~~~~
19 | : 0] = 0;
| ~~~~~^~~
0x18ed658 internal_error(char const*, ...)
???:0
0x102fb3e rs6000_expand_vector_set(rtx_def*, rtx_def*, rtx_def*)
???:0
0x14c652f gen_vec_setv4si(rtx_def*, rtx_def*, rtx_def*)
???:0
0xb92d78 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1