https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128718
Bug ID: 128718
Summary: powerpc64le: ICE: insn does not satisfy its
constraints in extract_constrain_insn at -O3 with
-mcpu=power10
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: shimizu2486 at gmail dot com
Target Milestone: ---
Target: powerpc64le-linux-gnu
Live reproducer: https://godbolt.org/z/xxWvd7caE
$ cat t1.c
_BitInt(65) m[2][2];
unsigned k, c;
unsigned r(int, int, int);
void f(void) {
__int128 x = r(0, 0, 0);
int y = r(0, 0, 0);
_BitInt(6) a = k;
k = 0;
for (int i = 0; i < 16; i++) {
m[x][0] = ((unsigned)m[(unsigned)m[(_BitInt(3))c][c] & 1][0] >= a) ^ x;
m[0][0] = (long)m[y][0];
a = m[0][c] = m[m[c][0]][0];
}
}
$ powerpc64le-linux-gnu-gcc -mcpu=power10 -O3 -c t1.c
t1.c: In function 'f':
t1.c:14:1: error: insn does not satisfy its constraints:
14 | }
| ^
(insn 2720 2472 2721 2 (set (reg:DI 26 26 [orig:1810 _341 ] [1810])
(mem:DI (pre_modify:DI (reg/f:DI 23 23 [1912])
(plus:DI (reg/f:DI 23 23 [1912])
(const_int 16 [0x10]))) [2 m[y_29][0]+0 S8 A128]))
"t1.c":11:13 discrim 458752 713 {*movdi_internal64}
(expr_list:REG_UNUSED (reg/f:DI 23 23 [1912])
(expr_list:REG_INC (reg/f:DI 23 23 [1912])
(nil))))
during RTL pass: cprop_hardreg
t1.c:14:1: internal compiler error: in extract_constrain_insn, at recog.cc:2856
powerpc64le trunk (372c32f911fa) ICE
powerpc64le trunk (028b8b62979f) ICE (2026-10-06)
-O3 and -Ofast with -mcpu=power10 or -mcpu=power11 ICE.
-O1, -O2, -Os, -Og, and -O3 with -mcpu=power9 compiles fine,
and so do -O3 -mcpu=power10 with -fno-auto-inc-dec or -fno-tree-vectorize.
powerpc64 (big-endian) with -mcpu=power10 -O3 compiles it.