* tree-vect-patterns.c (vect_recog_pow_pattern): Check that
FUNCTION_DECL exists and that it's a builtin.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167366
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-12-02 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-12-02 Jie Zhang <jie@codesourcery.com>
PR middle-end/46674
+2010-12-02 Richard Guenther <rguenther@suse.de>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/46663
+ * gcc.dg/vect/pr46663.c: New test.
+
2010-12-02 Jie Zhang <jie@codesourcery.com>
PR middle-end/46674
--- /dev/null
+/* { 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" } } */
return NULL;
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: