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
This commit is contained in:
Uros Bizjak 2007-10-12 10:37:17 +02:00 committed by Uros Bizjak
parent 900461f31f
commit 6d3bf8498d
4 changed files with 34 additions and 0 deletions

View 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

View 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

View file

@ -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);
}
}

View 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;