This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ EH vs Forced Unwinding, Round 3


On Thu, 2003-05-01 at 21:07, Richard Henderson wrote:
> Ok, so I've been looking at making catch(...) do what the majority of
> folks here think it should.  In the process I've fixed a whole raft of
> bugs in libstdc++ wrt the handling of foreign exceptions.

Thanks for that, and for persevering with this project.

> In effect, the transition to the catch clause usurped control from
> _Unwind_ForcedUnwind, and so we no longer have force_unwind_stop to
> tell us to exit cleanly when we get to the top of the stack.
> 
> The reason we didn't see this with just destructors is that they use
> _Unwind_Resume instead of __cxa_rethrow.  The reason for this difference
> is buried in real semantic differences between the two concepts in the
> C++ library standard.

Right.  I would expect that libpthread would do:

  __thread_start (void* (*fp)(void*), void *arg) {
    try {
      return (*fp)(arg); 
    } catch (__thread_exception_type) {
      // An unhandled thread cancellation exception.
      // Proceed with cancellation.
    }
  }

This could also be:

  } catch (...) { 
    if (__the_current_exception_is_thread_cancellation ()) {
      // Proceed with cancellation.
    } else
      throw;
  }

Please go ahead and check in your changes.

Please XFAIL your new forced-unwinding test.

And then, if you would, please close the PR for this issue; as I
understand it, we've now completed the compiler/V3 side of this issue,
and the remainder lies with the pthreads library.

Thanks again,

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]