diff options
author | Richard Biener <rguenther@suse.de> | 2018-10-19 14:27:57 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-10-19 14:27:57 +0000 |
commit | 6d2648763a1b8a74a85d04139c5d1391056810fa (patch) | |
tree | f3bd4d357918551739de39dcded5d5399a25e856 /gcc | |
parent | 30f7c08d96556c4fdbe772240a085f5d8c2393a4 (diff) | |
download | gcc-6d2648763a1b8a74a85d04139c5d1391056810fa.zip gcc-6d2648763a1b8a74a85d04139c5d1391056810fa.tar.gz gcc-6d2648763a1b8a74a85d04139c5d1391056810fa.tar.bz2 |
re PR tree-optimization/87657 (SLP ICE in libgfortran matmul_i2_vanilla)
2018-10-19 Richard Biener <rguenther@suse.de>
PR target/87657
* config/i386/i386.c (ix86_builtin_vectorization_cost): Use
TYPE_VECTOR_SUBPARTS and avoid relying on vector mode.
* gcc.target/i386/pr87657.c: New testcase.
From-SVN: r265316
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr87657.c | 22 |
4 files changed, 34 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50f8d78..082ef49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-19 Richard Biener <rguenther@suse.de> + + PR target/87657 + * config/i386/i386.c (ix86_builtin_vectorization_cost): Use + TYPE_VECTOR_SUBPARTS and avoid relying on vector mode. + 2018-10-19 H.J. Lu <hongjiu.lu@intel.com> PR target/72782 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e47603e..963c7fc 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -45173,9 +45173,8 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, case vec_construct: { - gcc_assert (VECTOR_MODE_P (mode)); /* N element inserts into SSE vectors. */ - int cost = GET_MODE_NUNITS (mode) * ix86_cost->sse_op; + int cost = TYPE_VECTOR_SUBPARTS (vectype) * ix86_cost->sse_op; /* One vinserti128 for combining two SSE vectors for AVX256. */ if (GET_MODE_BITSIZE (mode) == 256) cost += ix86_vec_cost (mode, ix86_cost->addss); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f216f0..4fd3f91 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-19 Richard Biener <rguenther@suse.de> + + PR target/87657 + * gcc.target/i386/pr87657.c: New testcase. + 2018-10-19 H.J. Lu <hongjiu.lu@intel.com> PR target/72782 diff --git a/gcc/testsuite/gcc.target/i386/pr87657.c b/gcc/testsuite/gcc.target/i386/pr87657.c new file mode 100644 index 0000000..14ba6b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87657.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-slp-vectorize -fno-vect-cost-model -mno-sse" } */ + +int x; + +void foo (short a, short b) +{ + ((short *)&x)[0] = a; + ((short *)&x)[1] = b; +} + +#if __SIZEOF_LONG__ == 8 +long y; + +void bar (short a, short b) +{ + ((short *)&y)[0] = a; + ((short *)&y)[1] = b; + ((short *)&y)[2] = a; + ((short *)&y)[3] = b; +} +#endif |