aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-30 13:48:37 +0000
committerJakub Jelinek <jakub@redhat.com>2012-01-30 13:48:37 +0000
commitfa2c70e5080b1ecb6ea076a567fba8a629e272af (patch)
treed611f349ef72e7c39faf03dcb10d5a45d92b41d3 /gcc/tree-vect-patterns.c
parent2e984c66433b2314dc105cfdd57a530abbd8a4f8 (diff)
PR tree-optimization/52046
* tree-vect-patterns.c (check_bool_pattern): Give up if a comparison could throw. * gcc.dg/pr52046.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@183724 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 34ac2e5329f..f63b4e593cc 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1,5 +1,5 @@
/* Analysis Utilities for Loop Vectorization.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Dorit Nuzman <dorit@il.ibm.com>
@@ -1967,6 +1967,11 @@ check_bool_pattern (tree var, loop_vec_info loop_vinfo)
{
tree vecitype, comp_vectype;
+ /* If the comparison can throw, then is_gimple_condexpr will be
+ false and we can't make a COND_EXPR/VEC_COND_EXPR out of it. */
+ if (stmt_could_throw_p (def_stmt))
+ return false;
+
comp_vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
if (comp_vectype == NULL_TREE)
return false;