From: Richard Biener Date: Thu, 28 Jan 2010 14:40:59 +0000 (+0000) Subject: re PR middle-end/42883 (internal compiler error: in redirect_eh_edge_1, at tree-eh... X-Git-Tag: releases/gcc-4.5.0~1006 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=r0-98233-g28e5ca15b76773;p=thirdparty%2Fgcc.git re PR middle-end/42883 (internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2112) 2010-01-28 Richard Guenther PR middle-end/42883 * tree-cfgcleanup.c (remove_forwarder_block): Do not remove the forwarder if the destination is an EH landing pad. * g++.dg/torture/pr42883.C: New testcase. From-SVN: r156322 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 147a8a26ada3..a96de7e2b765 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,10 @@ -28-01-2010 Razya Ladelsky +2010-01-28 Richard Guenther + + PR middle-end/42883 + * tree-cfgcleanup.c (remove_forwarder_block): Do not remove + the forwarder if the destination is an EH landing pad. + +2010-01-28 Razya Ladelsky * tree-parloops.c (transform_to_exit_first_loop): Update the basic block list passed to gimple_duplicate_sese_tail. @@ -7,7 +13,7 @@ Avoid parallelization when the preheader is IRREDUCIBLE. Try to optimize when estimated_loop_iterations_int is unresolved. Add the loop's location to the dump file. - * tree-cfg.c(add_phi_args_after_redirect): Remove. + * tree-cfg.c (add_phi_args_after_redirect): Remove. (gimple_duplicate_sese_tail): Remove the check for the latch. Redirect nexits to the exit block. Remove handling of the incoming edges to the latch. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 675c6c5f6035..7706f8702a25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-28 Richard Guenther + + PR middle-end/42883 + * g++.dg/torture/pr42883.C: New testcase. + 2010-01-28 Michael Matz * gcc.target/i386/pr42881.c: New test. diff --git a/gcc/testsuite/g++.dg/torture/pr42883.C b/gcc/testsuite/g++.dg/torture/pr42883.C new file mode 100644 index 000000000000..f164c3781f59 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr42883.C @@ -0,0 +1,63 @@ +// { dg-do compile } + +typedef __SIZE_TYPE__ size_t; +namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { + template class new_allocator { + public: + typedef size_t size_type; + typedef _Tp* pointer; + typedef _Tp& reference; + void deallocate(pointer __p, size_type) { + ::operator delete(__p); + } + }; +} +namespace std __attribute__ ((__visibility__ ("default"))) { + template class allocator: public __gnu_cxx::new_allocator<_Tp> { + public: + template struct rebind { + typedef allocator<_Tp1> other; + }; + }; + template struct _Vector_base { + typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; + struct _Vector_impl : public _Tp_alloc_type { + typename _Tp_alloc_type::pointer _M_start; + typename _Tp_alloc_type::pointer _M_end_of_storage; + }; + ~_Vector_base() { + _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); + } + _Vector_impl _M_impl; + void _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n) { + if (__p) _M_impl.deallocate(__p, __n); + } + }; + template > class vector : protected _Vector_base<_Tp, _Alloc> { + typedef _Vector_base<_Tp, _Alloc> _Base; + typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; + public: + typedef typename _Tp_alloc_type::reference reference; + typedef size_t size_type; + size_type size() const { + } + reference operator[](size_type __n) { + } + }; +}; +class vtkConvexPointSet { +public: + static vtkConvexPointSet *New(); +}; +void MakeInternalMesh() { + std::vector< int > tempFaces[2]; + std::vector< int > firstFace; + int i, j, k; + for(i = 0; i < 1000; i++) { + for(int pointCount = 0; pointCount < 1000; pointCount++) { + for(j = 0; j < (int)tempFaces[0].size(); k++) + if(tempFaces[0][j] == tempFaces[1][k]) break; + } + vtkConvexPointSet::New(); + } +} diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 201298dc5357..6810f4b08945 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -345,12 +345,13 @@ remove_forwarder_block (basic_block bb) if (dest == bb) return false; - /* If the destination block consists of a nonlocal label, do not merge - it. */ + /* If the destination block consists of a nonlocal label or is a + EH landing pad, do not merge it. */ label = first_stmt (dest); if (label && gimple_code (label) == GIMPLE_LABEL - && DECL_NONLOCAL (gimple_label_label (label))) + && (DECL_NONLOCAL (gimple_label_label (label)) + || EH_LANDING_PAD_NR (gimple_label_label (label)) != 0)) return false; /* If there is an abnormal edge to basic block BB, but not into