re PR tree-optimization/45470 (ICE: verify_flow_info failed: BB 2 can not throw but has an EH edge with -ftree-vectorize -fnon-call-exceptions)

PR tree-optimization/45470
	* tree-vect-data-refs.c (vect_analyze_data_refs): Fail if a statement
	can throw an exception.
	* tree-vect-stmts.c (vectorizable_call): Likewise.

From-SVN: r164270
This commit is contained in:
Ira Rosen 2010-09-14 09:21:15 +00:00 committed by Ira Rosen
parent 2f78283b38
commit 5a2c198638
6 changed files with 103 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2010-09-14 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/45470
* tree-vect-data-refs.c (vect_analyze_data_refs): Fail if a statement
can throw an exception.
* tree-vect-stmts.c (vectorizable_call): Likewise.
2010-09-14 DJ Delorie <dj@redhat.com>
PR target/44749

View File

@ -1,3 +1,9 @@
2010-09-14 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/45470
* g++.dg/vect/pr45470-a.cc: New test.
* g++.dg/vect/pr45470-a.cc: New test.
2010-09-10 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/42070

View File

@ -0,0 +1,24 @@
/* { dg-do compile } */
/* { dg-options "-O1 -ftree-vectorize -fnon-call-exceptions" } */
struct A
{
A (): a (0), b (0), c (0)
{
};
~A ();
int a, b, c;
};
struct B
{
B ();
A a1;
A a2;
};
B::B ()
{
}
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -0,0 +1,52 @@
/* { dg-do compile } */
/* { dg-options "-O1 -ftree-vectorize -fno-vect-cost-model -fnon-call-exceptions" } */
template < typename _Tp > struct new_allocator
{
typedef _Tp * pointer;
template < typename > struct rebind
{
typedef new_allocator other;
};
};
template < typename _Tp > struct allocator:public new_allocator < _Tp >
{};
template < typename _Tp, typename _Alloc > struct _Vector_base
{
typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type;
struct
{
typename _Tp_alloc_type::pointer _M_start;
typename _Tp_alloc_type::pointer _M_finish;
typename _Tp_alloc_type::pointer _M_end_of_storage;
};
};
template
<
typename
_Tp,
typename
_Alloc = allocator < _Tp > >struct vector:_Vector_base < _Tp, _Alloc >
{
typedef _Vector_base < _Tp, _Alloc > _Base;
vector ():_Base ()
{}
~vector ();
}
;
struct LoadGraph
{
LoadGraph (int);
vector < struct _GdkColor >colors;
vector < float >data_block;
};
LoadGraph::LoadGraph (int)
{}
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -2542,6 +2542,17 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
offset = unshare_expr (DR_OFFSET (dr));
init = unshare_expr (DR_INIT (dr));
if (stmt_could_throw_p (stmt))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
{
fprintf (vect_dump, "not vectorized: statement can throw an "
"exception ");
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
/* Update DR field in stmt_vec_info struct. */
/* If the dataref is in an inner-loop of the loop that is considered for

View File

@ -1343,6 +1343,9 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
if (TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
return false;
if (stmt_could_throw_p (stmt))
return false;
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
/* Process function arguments. */