diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-01-18 21:24:34 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-01-18 21:24:34 +0100 |
commit | e300ec2d1c230ea60b3f6eb36945ea87a0a7bc73 (patch) | |
tree | da7e3ef52eb40dfacc29f4829de7733eff7905d6 | |
parent | a3d7af04118e10c592dfdd9502a8368df3d34853 (diff) | |
download | gcc-e300ec2d1c230ea60b3f6eb36945ea87a0a7bc73.zip gcc-e300ec2d1c230ea60b3f6eb36945ea87a0a7bc73.tar.gz gcc-e300ec2d1c230ea60b3f6eb36945ea87a0a7bc73.tar.bz2 |
re PR tree-optimization/56029 (ICE: verify_gimple failed, location references block not in block tree)
PR tree-optimization/56029
* tree-phinodes.c (reserve_phi_args_for_new_edge): Set
gimple_phi_arg_location for the new arg to UNKNOWN_LOCATION.
* g++.dg/torture/pr56029.C: New test.
From-SVN: r195304
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr56029.C | 126 | ||||
-rw-r--r-- | gcc/tree-phinodes.c | 1 |
4 files changed, 138 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3113277..2d7a042 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-18 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/56029 + * tree-phinodes.c (reserve_phi_args_for_new_edge): Set + gimple_phi_arg_location for the new arg to UNKNOWN_LOCATION. + 2013-01-18 Sharad Singhai <singhai@google.com> PR tree-optimization/55995 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20ebbbb..0640b26 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-18 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/56029 + * g++.dg/torture/pr56029.C: New test. + 2013-01-18 Sharad Singhai <singhai@google.com> PR tree-optimization/55995 diff --git a/gcc/testsuite/g++.dg/torture/pr56029.C b/gcc/testsuite/g++.dg/torture/pr56029.C new file mode 100644 index 0000000..ca4a82a --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr56029.C @@ -0,0 +1,126 @@ +// PR tree-optimization/56029 +// { dg-do compile } + +template <class T> +struct DefaultDeleter +{ + void operator () (T * ptr) { delete ptr; } +}; +template <class T, class D> +struct scoped_ptr_impl +{ + scoped_ptr_impl (T * p):data_ (p) {} + template <typename U, typename V> + scoped_ptr_impl (scoped_ptr_impl <U, V> *other):data_ (other->release (), get_deleter ()) {} + ~scoped_ptr_impl () { static_cast <D> (data_) (data_.ptr); } + void reset (T * p) { data_.ptr = p; } + D get_deleter () {} + T *release () { data_.ptr = __null; } + struct Data + : D + { + Data (T *) : ptr () {} + Data (T *, D) : D (), ptr () {} + T *ptr; + }; + Data data_; +}; +template <class T, class D = DefaultDeleter <T> > +struct scoped_ptr +{ + struct RValue + { + RValue (scoped_ptr * object):object (object) {} + scoped_ptr *object; + }; + scoped_ptr Pass () { return scoped_ptr ((this)); } + typedef T element_type; + typedef D deleter_type; + scoped_ptr () : impl_ (__null) {} + scoped_ptr (RValue rvalue) : impl_ (&rvalue.object->impl_) {} + void reset (element_type * p) { impl_.reset (p); } + scoped_ptr_impl <element_type, deleter_type> impl_; +}; +template <typename> +struct Callback; +struct ClientSocketFactory; +struct DatagramClientSocket; +struct DnsSocketPool +{ + scoped_ptr <DatagramClientSocket> CreateConnectedSocket (); + ClientSocketFactory *socket_factory_; +}; +int RandInt (int, int); +struct BindStateBase {}; +struct CallbackBase +{ + CallbackBase (BindStateBase *); + ~CallbackBase (); +}; +template <typename, typename, typename> +struct BindState; +template <typename R, typename A1, typename A2> +struct Callback <R (A1, A2)> : CallbackBase +{ + template <typename Runnable, typename BindRunType, typename BoundArgsType> + Callback (BindState <Runnable, BindRunType, BoundArgsType> *bind_state) : CallbackBase (bind_state) {} +}; +typedef Callback <int (int, int)> +RandIntCallback; +struct ClientSocketFactory +{ + virtual DatagramClientSocket *CreateDatagramClientSocket (RandIntCallback) = 0; +}; +template <typename> +struct RunnableAdapter; +template <typename R, typename A1, typename A2> +struct RunnableAdapter <R (*) (A1, A2)> +{ + typedef R (RunType) (A1, A2); +}; +template <typename T> +struct FunctorTraits +{ + typedef RunnableAdapter <T> RunnableType; + typedef typename RunnableType::RunType RunType; +}; +template <typename T> +typename FunctorTraits <T>::RunnableType MakeRunnable (T) +{ +} +template <int, typename, typename> +struct Invoker; +template <typename StorageType, typename R, typename X1, typename X2> +struct Invoker <0, StorageType, R (X1, X2)> +{ + typedef R (UnboundRunType) (X1, X2); +}; +template <typename Runnable, typename RunType> +struct BindState <Runnable, RunType, void ()> : BindStateBase +{ + typedef Runnable RunnableType; + typedef Invoker <0, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + BindState (Runnable):runnable_ () {} + RunnableType runnable_; +}; +template <typename Functor> +Callback <typename BindState <typename FunctorTraits <Functor>::RunnableType, typename FunctorTraits <Functor>::RunType, void ()>::UnboundRunType> +Bind (Functor functor) +{ + typedef typename FunctorTraits <Functor>::RunnableType RunnableType; + typedef typename FunctorTraits <Functor>::RunType RunType; + typedef BindState <RunnableType, RunType, void ()> BindState; + Callback <typename BindState::UnboundRunType> (new BindState (MakeRunnable (functor))); +} +struct DatagramClientSocket +{ + virtual ~ DatagramClientSocket (); +}; +scoped_ptr <DatagramClientSocket> +DnsSocketPool::CreateConnectedSocket () +{ + scoped_ptr <DatagramClientSocket> socket; + socket.reset (socket_factory_->CreateDatagramClientSocket (Bind (RandInt))); + socket.Pass (); +} diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c index 50f3725..03a20fa 100644 --- a/gcc/tree-phinodes.c +++ b/gcc/tree-phinodes.c @@ -312,6 +312,7 @@ reserve_phi_args_for_new_edge (basic_block bb) redirects edges, and then fixes up PHI arguments later in batch. */ SET_PHI_ARG_DEF (stmt, len - 1, NULL_TREE); + gimple_phi_arg_set_location (stmt, len - 1, UNKNOWN_LOCATION); stmt->gimple_phi.nargs++; } |