re PR tree-optimization/46663 (ICE: SIGSEGV in vect_recog_pow_pattern (gimple.h:2055) with -O -fexceptions -ftree-vectorize)

PR tree-optimization/46663
	* tree-vect-patterns.c (vect_recog_pow_pattern): Check that
	FUNCTION_DECL exists and that it's a builtin.


Co-Authored-By: Ira Rosen <irar@il.ibm.com>

From-SVN: r167472
This commit is contained in:
Richard Guenther 2010-12-05 11:31:09 +00:00 committed by Ira Rosen
parent 7bc9f31dbf
commit c752146f9e
4 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2010-12-05 Richard Guenther <rguenther@suse.de>
Ira Rosen <irar@il.ibm.com>
PR tree-optimization/46663
* tree-vect-patterns.c (vect_recog_pow_pattern): Check that
FUNCTION_DECL exists and that it's a builtin.
2010-11-29 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/46337

View File

@ -1,3 +1,9 @@
2010-12-05 Richard Guenther <rguenther@suse.de>
Ira Rosen <irar@il.ibm.com>
PR tree-optimization/46663
* gcc.dg/vect/pr46663.c: New test.
2010-11-28 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/aliasing2.adb (dg-final): Robustify pattern matching.

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-O -ftree-vectorize -fdump-tree-vect-details -fexceptions" } */
typedef __attribute__ ((const)) int (*bart) (void);
int foo (bart bar, int m)
{
int i, j = 0;
for (i = 0; i < m; i++)
j += bar();
return j;
}
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -475,6 +475,9 @@ vect_recog_pow_pattern (gimple last_stmt, tree *type_in, tree *type_out)
type = gimple_expr_type (last_stmt);
fn = gimple_call_fndecl (last_stmt);
if (fn == NULL_TREE || DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL)
return NULL;
switch (DECL_FUNCTION_CODE (fn))
{
case BUILT_IN_POWIF: