Commit 3a542b98 authored by jakub's avatar jakub
Browse files

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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183724 138bc75d-0d04-0410-961f-82ee72b054a4
parent 30e4f955
2012-01-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52046
* tree-vect-patterns.c (check_bool_pattern): Give up if
a comparison could throw.
PR debug/52048
* tree-ssa-tail-merge.c (local_def): Ignore debug uses.
......
2012-01-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52046
* gcc.dg/pr52046.c: New test.
PR debug/52048
* g++.dg/other/pr52048.C: New test.
......
/* PR tree-optimization/52046 */
/* { dg-do compile } */
/* { dg-options "-O3 -fexceptions -fnon-call-exceptions" } */
extern float a[], b[], c[], d[];
extern int k[];
void
foo (void)
{
int i;
for (i = 0; i < 1024; ++i)
k[i] = (a[i] < b[i]) | (c[i] < d[i]);
}
/* 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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment