https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69255
Bug ID: 69255 Summary: ICE (segfault) on x86_64-linux-gnu in "emit_move_insn" Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk on x86_64-linux-gnu in 64-bit mode. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20160112 (experimental) [trunk revision 232269] (GCC) $ gcc-trunk -c abc.c abc.c: In function ‘fun1’: abc.c:7:40: warning: passing argument 2 of ‘__builtin_ia32_gather3siv4di’ from incompatible pointer type [-Wincompatible-pointer-types] a = __builtin_ia32_gather3siv4di (a, fun1, b, 1, 1); ^~~~ abc.c:7:40: note: expected ‘const long long int *’ but argument is of type ‘int (*)()’ abc.c:7:7: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi] a = __builtin_ia32_gather3siv4di (a, fun1, b, 1, 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abc.c:7:7: error: ‘__builtin_ia32_gather3siv4di’ needs isa option -m32 -mavx512vl a = __builtin_ia32_gather3siv4di (a, fun1, b, 1, 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abc.c:7:7: internal compiler error: in emit_move_insn, at expr.c:3546 0x84446f emit_move_insn(rtx_def*, rtx_def*) ../../gcc/gcc/expr.c:3545 0x84ae0d store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*) ../../gcc/gcc/expr.c:5583 0x84c410 expand_assignment(tree_node*, tree_node*, bool) ../../gcc/gcc/expr.c:5175 0x74058a expand_call_stmt ../../gcc/gcc/cfgexpand.c:2646 0x74058a expand_gimple_stmt_1 ../../gcc/gcc/cfgexpand.c:3536 0x74058a expand_gimple_stmt ../../gcc/gcc/cfgexpand.c:3702 0x743624 expand_gimple_basic_block ../../gcc/gcc/cfgexpand.c:5708 0x7485f6 execute ../../gcc/gcc/cfgexpand.c:6323 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. ---------------- $ cat abc.c #pragma GCC target "avx512vl" #pragma GCC target "" __attribute__ ((__vector_size__ (4 * sizeof (long)))) long long a; __attribute__ ((__vector_size__ (2 * sizeof (long)))) int b; int fun1 () { a = __builtin_ia32_gather3siv4di (a, fun1, b, 1, 1); }