===================================================================
@@ -2542,6 +2542,17 @@ vect_analyze_data_refs (loop_vec_info lo
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
===================================================================
@@ -1343,6 +1343,9 @@ vectorizable_call (gimple stmt, gimple_s
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. */
===================================================================
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize -fno-vect-cost-model
-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" } } */
===================================================================
@@ -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" } } */