diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-12 08:37:17 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-12 08:37:17 +0000 |
commit | f1f6fb1dd24936083f1d5c2829b506222a9396a3 (patch) | |
tree | 9b3315ec9294785693c2e914f816a352e4806dfc /gcc | |
parent | a93b21ea450bb4af28f6d4f8b10956947ad3d51a (diff) | |
download | gcc-f1f6fb1dd24936083f1d5c2829b506222a9396a3.tar.gz |
PR tree-optimization/33742
* tree-vect-transform.c (vectorizable_operation): Return false
if get_vectype_for_scalar_type for scalar_dest can't be determined.
(vectorizable_call): Same for rhs_type and lhs_type.
testsuite/ChangeLog:
PR tree-optimization/33742
* gcc.dg/pr33742.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr33742.c | 16 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 6 |
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1f44631d68..28590a6c41b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-10-12 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/33742 + * tree-vect-transform.c (vectorizable_operation): Return false + if get_vectype_for_scalar_type for scalar_dest can't be determined. + (vectorizable_call): Same for rhs_type and lhs_type. + 2007-10-12 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/33645 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 79626fc1172..cacf0a9ed7d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-10-12 Uros Bizjak <ubizjak@gmail.com> + + PR tree-optimization/33742 + * gcc.dg/pr33742.c: New testcase. + 2007-10-12 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/33645 diff --git a/gcc/testsuite/gcc.dg/pr33742.c b/gcc/testsuite/gcc.dg/pr33742.c new file mode 100644 index 00000000000..b905d9ddad9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr33742.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-vectorize" } */ + +typedef unsigned short ush; +extern ush prev[]; + +void fill_window () +{ + register unsigned n, m; + + for (n = 0; n < 32768; n++) + { + m = prev[n]; + prev[n] = (ush) (m >= 0x8000 ? m - 0x8000 : 0); + } +} diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index f02d912b29f..423ae65d964 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -3016,10 +3016,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt) return false; vectype_in = get_vectype_for_scalar_type (rhs_type); + if (!vectype_in) + return false; nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in); lhs_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0)); vectype_out = get_vectype_for_scalar_type (lhs_type); + if (!vectype_out) + return false; nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); /* FORNOW */ @@ -3804,6 +3808,8 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt, scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0); vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest)); + if (!vectype_out) + return false; nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); if (nunits_out != nunits_in) return false; |