OSDN Git Service

PR tree-optimization/33742
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Oct 2007 08:37:17 +0000 (08:37 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Oct 2007 08:37:17 +0000 (08:37 +0000)
* 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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr33742.c [new file with mode: 0644]
gcc/tree-vect-transform.c

index c1f4463..28590a6 100644 (file)
@@ -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
index 79626fc..cacf0a9 100644 (file)
@@ -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 (file)
index 0000000..b905d9d
--- /dev/null
@@ -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);
+    }
+}
index f02d912..423ae65 100644 (file)
@@ -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;