https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122873
Bug ID: 122873
Summary: [16 regression] ICE in convert_move AArch64
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: matmal01 at gcc dot gnu.org
Target Milestone: ---
ICE with the following testcase:
```
#include <vector>
#include <array>
struct B
{
std::array<std::vector<unsigned char>, 10> nums;
};
struct A
{
int nr;
};
std::vector<int> outsidefunc(std::vector<int>, bool, B, A);
void do_init(A *);
std::vector<int> repro(B input) {
std::vector<int> check;
check.push_back(9);
A gather;
do_init(&gather);
bool allZero = true;
for (auto gtype : check)
for (int a = 0; a < gather.nr; a++)
if (input.nums[gtype][a])
allZero = false;
return outsidefunc(check, allZero, input, gather);
}
```
Compiled using TOT on AArch64 with the following command line:
```
/local$HOME/gcc-install/bin/g++ \
-O3 -march=native -mcpu=neoverse-v2 \
-fPIC -msve-vector-bits=128 \
-Wall -Wextra \
-o repro.cpp.o -c repro.cpp
```
Gives the following ICE
```
during RTL pass: expand
repro.cpp: In function ‘std::vector<int> repro(B)’:
repro.cpp:16:18: internal compiler error: in convert_move, at expr.cc:305
16 | std::vector<int> repro(B input) {
| ^~~~~
0x274af27 internal_error(char const*, ...)
../../gcc-source/gcc/diagnostic-global-context.cc:787
0x893807 fancy_abort(char const*, int, char const*)
../../gcc-source/gcc/diagnostics/context.cc:1805
0xf27d53 convert_move(rtx_def*, rtx_def*, int)
../../gcc-source/gcc/expr.cc:305
0xf16c6b expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
../../gcc-source/gcc/expr.cc:10045
0xf25053 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-source/gcc/expr.cc:11335
0xf21617 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-source/gcc/expr.cc:11525
0xf1a11f expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
../../gcc-source/gcc/expr.cc:9601
0xf1a11f expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
../../gcc-source/gcc/expr.h:323
0xf1a11f expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
../../gcc-source/gcc/expr.cc:9952
0xf25053 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-source/gcc/expr.cc:11335
0xdc893f expand_gimple_stmt_1
../../gcc-source/gcc/cfgexpand.cc:4318
0xdc893f expand_gimple_stmt
../../gcc-source/gcc/cfgexpand.cc:4382
0xdce643 expand_gimple_basic_block
../../gcc-source/gcc/cfgexpand.cc:6501
0xdd0cc7 execute
../../gcc-source/gcc/cfgexpand.cc:7248
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.
```
Unfortunately can not pinpoint exact commit that introduced this problem, since
before the fix to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122370 this
reduced testcase was showing the ICE in that PR.