From 78336739dea412bb0ff9431acbb96222c41c0ced Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Thu, 1 Dec 2011 20:14:03 +0100
Subject: [PATCH] re PR tree-optimization/51356 (FAIL:
 gfortran.dg/anyallcount_1.f90  -O3  (internal compiler error) on
 powerpc-apple-darwin9 with -m32)

	PR tree-optimization/51356
	* tree-vect-patterns.c (vect_recog_bool_pattern): Give up if
	vectype doesn't have VECTOR_MODE_P.

From-SVN: r181891
---
 gcc/ChangeLog            | 4 ++++
 gcc/tree-vect-patterns.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0ab88fa1198f..c8a71dbd53ab 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
 2011-12-01  Jakub Jelinek  <jakub@redhat.com>
 
+	PR tree-optimization/51356
+	* tree-vect-patterns.c (vect_recog_bool_pattern): Give up if
+	vectype doesn't have VECTOR_MODE_P.
+
 	PR debug/50317
 	* tree-ssa-dce.c (remove_dead_stmt): Add a debug stmt when removing
 	as unnecessary a store to a variable with gimple reg type.
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 22414475f6f8..306bac28c18f 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -2074,6 +2074,8 @@ vect_recog_bool_pattern (VEC (gimple, heap) **stmts, tree *type_in,
       stmt_vec_info pattern_stmt_info;
       vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
       gcc_assert (vectype != NULL_TREE);
+      if (!VECTOR_MODE_P (TYPE_MODE (vectype)))
+	return NULL;
       if (!check_bool_pattern (var, loop_vinfo))
 	return NULL;
 
-- 
GitLab