https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94488
--- Comment #3 from Evan Nemerson <e...@coeus-group.com> --- Thanks for looking into this. Left shift instead of right also seems to be a problem. The backtrace is a bit different, but I figure it's probably the same issue; if not I can open up a new report. I actually have something similar in my code with a note that it failed on GCC ≤ 7 (<https://github.com/nemequ/simde/blob/9efa34cddce5a5281f6909d48b11d5639ec0b519/simde/x86/sse2.h#L4409>). My guess is that GCC 7 fails all the time but GCC 8+ requires optimization, but I don't have convenient access to GCC 7 on AArch64 so I'm not certain. Here is the output from left shift: during RTL pass: expand foo.c: In function ‘foo’: foo.c:4:12: internal compiler error: in copy_to_mode_reg, at explow.c:632 4 | return x << y; | ~~^~~~ 0x613b07 copy_to_mode_reg(machine_mode, rtx_def*) ../../src/gcc/explow.c:632 0xe19ea3 aarch64_expand_vector_init(rtx_def*, rtx_def*) ../../src/gcc/config/aarch64/aarch64.c:17670 0x10ed6fc ??? ../../src/gcc/config/aarch64/aarch64-simd.md:6140 0xa62722 insn_gen_fn::operator()(rtx_def*, rtx_def*) const ../../src/gcc/recog.h:317 0xa62722 expand_vector_broadcast(machine_mode, rtx_def*) ../../src/gcc/optabs.c:438 0xa641b0 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*, int, optab_methods) ../../src/gcc/optabs.c:1300 0x83d69f expand_shift_1 ../../src/gcc/expmed.c:2624 0x83dce5 expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*, rtx_def*, int) ../../src/gcc/expmed.c:2695 0x85053b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) ../../src/gcc/expr.c:9477 0x85725d expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:10049 0x75cd2a expand_expr ../../src/gcc/expr.h:282 0x75cd2a expand_return ../../src/gcc/cfgexpand.c:3611 0x75cd2a expand_gimple_stmt_1 ../../src/gcc/cfgexpand.c:3720 0x75cd2a expand_gimple_stmt ../../src/gcc/cfgexpand.c:3847 0x7627ea expand_gimple_basic_block ../../src/gcc/cfgexpand.c:5887 0x7627ea execute ../../src/gcc/cfgexpand.c:6542 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.