diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-11-19 19:52:54 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2017-11-19 18:52:54 +0000 |
commit | 66c92903354abc47638f2f78e027dd737404ffca (patch) | |
tree | 0d5e0c6767f7be0be2154f81b7a673276f8c5599 /gcc | |
parent | f9c59f7e9511856bd6dc13d2d4904ebd9249c095 (diff) | |
download | gcc-66c92903354abc47638f2f78e027dd737404ffca.zip gcc-66c92903354abc47638f2f78e027dd737404ffca.tar.gz gcc-66c92903354abc47638f2f78e027dd737404ffca.tar.bz2 |
re PR target/82713 (ICE in ix86_builtin_vectorization_cost, at config/i386/i386.c:44475)
PR target/82713
* i386.c (ix86_builtin_vectorization_cost): Be ready for insane
types.
From-SVN: r254933
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr82713.c | 19 |
4 files changed, 42 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a6a3ab..17aa792 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-11-19 Jan Hubicka <hubicka@ucw.cz> + + PR target/82713 + * i386.c (ix86_builtin_vectorization_cost): Be ready for insane + types. + 2017-11-19 Tom de Vries <tom@codesourcery.com> * config/arc/arc.h (FUNCTION_PROFILER): Remove semicolon after diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 835c73d..339932e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -44628,13 +44628,18 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, case vector_load: index = sse_store_index (mode); - gcc_assert (index >= 0); + /* See PR82713 - we may end up being called on non-vector type. */ + if (index < 0) + index = 2; return ix86_vec_cost (mode, COSTS_N_INSNS (ix86_cost->sse_load[index]) / 2, true); case vector_store: index = sse_store_index (mode); + /* See PR82713 - we may end up being called on non-vector type. */ + if (index < 0) + index = 2; return ix86_vec_cost (mode, COSTS_N_INSNS (ix86_cost->sse_store[index]) / 2, true); @@ -44647,6 +44652,9 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, Do that incrementally. */ case unaligned_load: index = sse_store_index (mode); + /* See PR82713 - we may end up being called on non-vector type. */ + if (index < 0) + index = 2; return ix86_vec_cost (mode, COSTS_N_INSNS (ix86_cost->sse_unaligned_load[index]) / 2, @@ -44654,6 +44662,9 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, case unaligned_store: index = sse_store_index (mode); + /* See PR82713 - we may end up being called on non-vector type. */ + if (index < 0) + index = 2; return ix86_vec_cost (mode, COSTS_N_INSNS (ix86_cost->sse_unaligned_store[index]) / 2, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 705730b..fe7a528 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-19 Jan Hubicka <hubicka@ucw.cz> + + PR target/82713 + * gcc.target/i386/pr82713.c: New testcase. + 2017-11-19 Jakub Jelinek <jakub@redhat.com> PR c/66618 diff --git a/gcc/testsuite/gcc.target/i386/pr82713.c b/gcc/testsuite/gcc.target/i386/pr82713.c new file mode 100644 index 0000000..2c2295e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr82713.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +* { dg-options "-O3 -mavx512bw" } */ + +_Bool a[2048]; +int b[2048]; + +void +foo () +{ + int i; + for (i = 0; i < 2048; i += 4) + { + a[i] = b[i] <= 10; + a[i + 3] = b[i + 1] <= 10; + a[i + 2] = b[i + 2] <= 10; + a[i + 1] = b[i + 3] <= 10; + } +} + |