https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95528
Bug ID: 95528
Summary: internal compiler error: in emit_move_insn, at
expr.c:3814
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: slyfox at inbox dot ru
Target Milestone: ---
The bug is initially reported in https://bugs.gentoo.org/727028 as an ICE on
firefox-77 code by Thomas Deutschmann.
Here is the minimal reproducer reduced by creduce:
$ cat bug.cc
template <typename a> struct b {
typedef a c __attribute__((vector_size(sizeof(a) * 4)));
union {
c d;
struct {
a e, f, g, h;
};
};
b();
b(const b &i) : d(i.d) {}
static b j(c);
template <typename k> operator b<k>() {
b<k>::j(typename b<k>::c{e, f, g, h});
}
};
template <typename a> using l = b<a>;
using m = l<char>;
using n = l<short>;
m o(n i) { return i; }
b<short> q;
void p() { o(q); }
$ LANG=C /usr/bin/x86_64-pc-linux-gnu-g++ -march=skylake-avx512 -O2 -c bug.cc
-o bug.o
during RTL pass: expand
bug.cc: In function 'void p()':
bug.cc:13:12: internal compiler error: in emit_move_insn, at expr.c:3814
13 | b<k>::j(typename b<k>::c{e, f, g, h});
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x5cb5cc emit_move_insn(rtx_def*, rtx_def*)
../../gcc-11.0.0_pre9999/gcc/expr.c:3814
0x82e459 load_register_parameters
../../gcc-11.0.0_pre9999/gcc/calls.c:3143
0x82e459 expand_call(tree_node*, rtx_def*, int)
../../gcc-11.0.0_pre9999/gcc/calls.c:4589
0x942856 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc-11.0.0_pre9999/gcc/expr.c:11135
0x94cc64 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
../../gcc-11.0.0_pre9999/gcc/expr.c:8358
0x94cc64 store_expr(tree_node*, rtx_def*, int, bool, bool)
../../gcc-11.0.0_pre9999/gcc/expr.c:5752
0x94e1f9 expand_assignment(tree_node*, tree_node*, bool)
../../gcc-11.0.0_pre9999/gcc/expr.c:5514
0x83c40a expand_call_stmt
../../gcc-11.0.0_pre9999/gcc/cfgexpand.c:2701
0x83c40a expand_gimple_stmt_1
../../gcc-11.0.0_pre9999/gcc/cfgexpand.c:3682
0x83c40a expand_gimple_stmt
../../gcc-11.0.0_pre9999/gcc/cfgexpand.c:3847
0x842916 expand_gimple_basic_block
../../gcc-11.0.0_pre9999/gcc/cfgexpand.c:5887
0x842916 execute
../../gcc-11.0.0_pre9999/gcc/cfgexpand.c:6571
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
Both gcc-10 and gcc-master are affected.
gcc-master crash for comparison:
$ ${HOME}/dev/git/gcc-native-quick/gcc/xg++ -B
${HOME}/dev/git/gcc-native-quick/gcc -march=skylake-avx512 -O2 -c bug.cc -o
bug.o
during RTL pass: expand
bug.cc: In function 'void p()':
bug.cc:13:12: internal compiler error: in emit_move_insn, at expr.c:3814
13 | b<k>::j(typename b<k>::c{e, f, g, h});
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x7f1550e53d59 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ ${HOME}/dev/git/gcc-native-quick/gcc/xg++ -B
${HOME}/dev/git/gcc-native-quick/gcc -v
Reading specs from /home/slyfox/dev/git/gcc-native-quick/gcc/specs
COLLECT_GCC=/home/slyfox/dev/git/gcc-native-quick/gcc/xg++
COLLECT_LTO_WRAPPER=/home/slyfox/dev/git/gcc-native-quick/gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,c++ --disable-bootstrap
--with-multilib-list=m64
--prefix=/home/slyfox/dev/git/gcc-native-quick/../gcc-native-quick-installed
--disable-nls --without-isl --disable-libsanitizer --disable-libvtv
--disable-libgomp --disable-libstdcxx-pch --disable-libunwind-exceptions
CFLAGS='-O1 ' CXXFLAGS='-O1 ' --with-sysroot=/usr/x86_64-HEAD-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20200604 (experimental) (GCC)
Not sure if it's the same as bug #95394. That bug says it's a gcc-11
regression, but this one happens on gcc-10.1.0 as well.