Starting from r244263 (when -mavx512vpopcntdq option was introduced), we ICE on: $ cat ice.c typedef __attribute__ ((vector_size (16))) char a; a b, c; void d () { int e; b = c << e; } $ gcc -mavx512vpopcntdq -mxop ice.c -c ice.c: In function ‘d’: ice.c:7:9: internal compiler error: in ix86_vector_duplicate_value, at config/i386/i386.c:42584 b = c << e; ~~^~~~ 0x13741b2 ix86_vector_duplicate_value ../../gcc/config/i386/i386.c:42584 0x1374509 ix86_expand_vector_init_duplicate ../../gcc/config/i386/i386.c:42675 0x13766fe ix86_expand_vector_init(bool, rtx_def*, rtx_def*) ../../gcc/config/i386/i386.c:43502 0x1674cc0 gen_vec_initv16qi(rtx_def*, rtx_def*) ../../gcc/config/i386/sse.md:6894 0x16a2fb6 gen_ashlv16qi3(rtx_def*, rtx_def*, rtx_def*) ../../gcc/config/i386/sse.md:16922 0xd1ee05 insn_gen_fn::operator()(rtx_def*, rtx_def*, rtx_def*) const ../../gcc/recog.h:302 0xdbbffc maybe_gen_insn(insn_code, unsigned int, expand_operand*) ../../gcc/optabs.c:7045 0xdacef7 expand_binop_directly ../../gcc/optabs.c:1071 0xdad21e expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*, int, optab_methods) ../../gcc/optabs.c:1151 0xab25e2 expand_shift_1 ../../gcc/expmed.c:2445 0xab273e expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*, rtx_def*, int) ../../gcc/expmed.c:2495 0xadbfad expand_expr_real_2(separate_ops*, rtx_def*, machine_mode, expand_modifier) ../../gcc/expr.c:9207 0x975b39 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3676 0x975d96 expand_gimple_stmt ../../gcc/cfgexpand.c:3737 0x97d5f6 expand_gimple_basic_block ../../gcc/cfgexpand.c:5744 0x97f0a6 execute ../../gcc/cfgexpand.c:6357
Created attachment 40960 [details] Patch in testing
Author: uros Date: Wed Mar 15 13:38:51 2017 New Revision: 246161 URL: https://gcc.gnu.org/viewcvs?rev=246161&root=gcc&view=rev Log: PR target/80019 * config/i386/i386.c (ix86_vector_duplicate_value): Create subreg of inner mode for values already in registers. testsuite/ChangeLog: PR target/80019 * gcc.target/i386/pr80019.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr80019.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/testsuite/ChangeLog
Author: uros Date: Wed Mar 15 15:27:28 2017 New Revision: 246166 URL: https://gcc.gnu.org/viewcvs?rev=246166&root=gcc&view=rev Log: PR target/80019 * config/i386/i386.c (ix86_vector_duplicate_value): Create subreg of inner mode for values already in registers. testsuite/ChangeLog: PR target/80019 * gcc.target/i386/pr80019.c: New test. Added: branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr80019.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/config/i386/i386.c branches/gcc-6-branch/gcc/testsuite/ChangeLog
Author: uros Date: Wed Mar 15 16:15:53 2017 New Revision: 246168 URL: https://gcc.gnu.org/viewcvs?rev=246168&root=gcc&view=rev Log: PR target/80019 * config/i386/i386.c (ix86_vector_duplicate_value): Create subreg of inner mode for values already in registers. testsuite/ChangeLog: PR target/80019 * gcc.target/i386/pr80019.c: New test. Added: branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr80019.c Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/config/i386/i386.c branches/gcc-5-branch/gcc/testsuite/ChangeLog
Fixed everywhere.
*** Bug 79810 has been marked as a duplicate of this bug. ***