https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128864
Bug ID: 128864
Summary: ICE on valid code at -O2 and -O3 in
vect_schedule_slp_node, at tree-vect-slp.cc:12409
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: haoxintu at gmail dot com
Target Milestone: ---
Hi,
$cat repro.c
__attribute__((noipa)) int f (unsigned char x, unsigned char y)
{
unsigned char a, b;
asm goto ("movb %2, %0\n\tmovb %3, %1\n\ttestb %2, %2\n\tjz %l[l1]"
: "=&q" (a), "=&q" (b) : "q" (x), "q" (y) : "cc" : l1);
return a * 8 + b * 4;
l1:
return a * 2 + b * 5;
}
int main (void)
{
if (f (3, 7) != 3 * 8 + 7 * 4) __builtin_abort ();
if (f (0, 9) != 0 * 2 + 9 * 5) __builtin_abort ();
return 0;
}
$gcc -c -O2 repro.c
uring GIMPLE pass: slp
repro.c: In function 'f':
repro.c:3:28: internal compiler error: in vect_schedule_slp_node, at
tree-vect-slp.cc:12387
3 | __attribute__((noipa)) int f (unsigned char x, unsigned char y)
| ^
0x5f0189d internal_error(char const*, ...)
/home/haoxin/research/cottontail/gcc/gcc/diagnostic-global-context.cc:787
0x5f1cd18 fancy_abort(char const*, int, char const*)
/home/haoxin/research/cottontail/gcc/gcc/diagnostics/context.cc:1813
0x2b1b8ab vect_schedule_slp_node
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:12387
0x2b1eb00 vect_schedule_scc
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:12787
0x2b1e85f vect_schedule_scc
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:12765
0x2b1fd54 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>&,
bool)
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:12956
0x2b0f750 vect_slp_analyze_bb_1
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:10516
0x2b0faf3 vect_slp_region
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:10569
0x2b11905 vect_slp_bbs
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:10792
0x2b126c5 vect_slp_function(function*)
/home/haoxin/research/cottontail/gcc/gcc/tree-vect-slp.cc:10914
0x2b61b04 execute
/home/haoxin/research/cottontail/gcc/gcc/tree-vectorizer.cc:1573
/home/haoxin/research/cottontail/gcc/build-gcov/install/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu repro.c -quiet -dumpbase repro.c
-dumpbase-ext .c -mtune=generic -march=x86-64 -O2 -o /tmp/ccWwN3To.s
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.
Reproduced in Godbolt: https://godbolt.org/z/4PPWeK5e1
Thanks.