This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR50343
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Sep 2011 07:59:35 +0200 (CEST)
- Subject: [PATCH] Fix PR50343
This fixes PR50343.
Committed as obvious.
Richard.
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.
Index: gcc/tree-vect-patterns.c
===================================================================
--- gcc/tree-vect-patterns.c (revision 178725)
+++ gcc/tree-vect-patterns.c (working copy)
@@ -256,6 +256,8 @@ vect_recog_dot_prod_pattern (VEC (gimple
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);