Commit 6d3bf849 by Uros Bizjak Committed by Uros Bizjak

re PR tree-optimization/33742 (Segfault in vectorizable_operation)

	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.

From-SVN: r129255
parent 900461f3
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> 2007-10-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33645 PR tree-optimization/33645
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> 2007-10-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33645 PR tree-optimization/33645
/* { 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);
}
}
...@@ -3016,10 +3016,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt) ...@@ -3016,10 +3016,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false; return false;
vectype_in = get_vectype_for_scalar_type (rhs_type); vectype_in = get_vectype_for_scalar_type (rhs_type);
if (!vectype_in)
return false;
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in); nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
lhs_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0)); lhs_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
vectype_out = get_vectype_for_scalar_type (lhs_type); vectype_out = get_vectype_for_scalar_type (lhs_type);
if (!vectype_out)
return false;
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
/* FORNOW */ /* FORNOW */
...@@ -3804,6 +3808,8 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt, ...@@ -3804,6 +3808,8 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0); scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest)); vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
if (!vectype_out)
return false;
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
if (nunits_out != nunits_in) if (nunits_out != nunits_in)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment