2011-09-12 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 06:01:15 +0000 (06:01 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 06:01:15 +0000 (06:01 +0000)
PR tree-optimization/50343
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Check
that the reduction is over an SSA name before checking its
definition.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178775 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-vect-patterns.c

index 4ae39c2..ad8f931 100644 (file)
@@ -1,3 +1,10 @@
+2011-09-12  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/50343
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Check
+       that the reduction is over an SSA name before checking its
+       definition.
+
 2011-09-11  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * config/cris/cris.md: Use match_test rather than eq/ne symbol_ref
index 0d78882..7fc107c 100644 (file)
@@ -256,6 +256,8 @@ vect_recog_dot_prod_pattern (VEC (gimple, heap) **stmts, tree *type_in,
      we know that oprnd1 is the reduction variable (defined by a loop-header
      phi), and oprnd0 is an ssa-name defined by a stmt in the loop body.
      Left to check that oprnd0 is defined by a (widen_)mult_expr  */
+  if (TREE_CODE (oprnd0) != SSA_NAME)
+    return NULL;
 
   prod_type = half_type;
   stmt = SSA_NAME_DEF_STMT (oprnd0);