Bug 80019 - ICE in ix86_vector_duplicate_value, at config/i386/i386.c:42584
Summary: ICE in ix86_vector_duplicate_value, at config/i386/i386.c:42584
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 5.5
Assignee: Uroš Bizjak
URL:
Keywords: ice-on-valid-code
: 79810 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-12 19:35 UTC by Martin Liška
Modified: 2017-08-09 13:34 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2017-03-13 00:00:00


Attachments
Patch in testing (363 bytes, patch)
2017-03-13 15:38 UTC, Uroš Bizjak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2017-03-12 19:35:44 UTC
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
Comment 1 Uroš Bizjak 2017-03-13 15:38:08 UTC
Created attachment 40960 [details]
Patch in testing
Comment 2 uros 2017-03-15 13:39:23 UTC
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
Comment 3 uros 2017-03-15 15:28:00 UTC
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
Comment 4 uros 2017-03-15 16:16:25 UTC
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
Comment 5 Uroš Bizjak 2017-03-15 16:17:10 UTC
Fixed everywhere.
Comment 6 H.J. Lu 2017-08-09 13:34:59 UTC
*** Bug 79810 has been marked as a duplicate of this bug. ***