Commit Graph

11 Commits

Author SHA1 Message Date
Paolo Carlini 110a123aae re PR libstdc++/40296 ([C++0x] std::exception_ptr comparisons)
2009-06-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/40296
	* libsupc++/exception_ptr.h (exception_ptr::operator!,
	exception_ptr::operator __safe_bool): Only declare when
	_GLIBCXX_EH_PTR_COMPAT is undefined.
	* libsupc++/eh_ptr.cc: Define _GLIBCXX_EH_PTR_COMPAT before including
	exception_ptr.
	* testsuite/18_support/exception_ptr/40296.cc: New.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Adjust.
	* testsuite/18_support/nested_exception/cons.cc: Likewise.
	* testsuite/18_support/nested_exception/nested_ptr.cc: Likewise.
	* testsuite/18_support/exception_ptr/current_exception.cc: Likewise.

From-SVN: r148122
2009-06-03 10:37:20 +00:00
Jan Hubicka 5cf217fff1 * eh_type.cc (__cxa_current_exception_type) Mark throw().
* unwind-cxx.h (__cxa_get_globals, __cxa_get_globals_fast): Mark const.
	(__cxa_get_exception_ptr): Mark pure.
	(__cxa_bad_cast, __cxa_bad_typeid): Mark noreturn
	(__terminate): Makr throw ().
	* exception (terminate): Mark throw().
	(uncaught_exception): Mark pure.
	* eh_ptr.cc (_M_safe_bool_dummy): Mark throw().
	* guard.cc (__cxa_guard_abort, __cxa_guard_release): Mark throw().
	* eh_terminate.cc (__terminate, terminate): Mark throw().
	* vec.cc (__cxa_vec_cleanup): Mark throw().
	* cxxabi.h (__cxa_vec_cleanup, __cxa_guard_release, __cxa_guard_abort): Mark throw ().
	(__cxa_pure_virtual): Mark noreturn.
	(__cxa_current_exception_type): Mark throw and pure.
	* exception_ptr.h (operator ==, !=, _M_get, !, ==,
	__cxa_exception_type): Mark pure.
	(_M_safe_bool_dummy): Mark pure and const.

From-SVN: r146331
2009-04-18 22:18:21 +00:00
Jakub Jelinek 748086b7b2 Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.
From-SVN: r145841
2009-04-09 17:00:19 +02:00
Jakub Jelinek c4bca01b27 re PR libstdc++/38732 (Openoffice.org segfaults with runtime libs built from GCC trunk)
PR libstdc++/38732
	* libsupc++/unwind-cxx.h (__cxxabiv1::__cxa_exception): Remove
	referenceCount field again.
	(__cxxabiv1::__cxa_refcounted_exception): New struct.
	(__cxxabiv1::__get_refcounted_exception_header_from_obj,
	__cxxabiv1::__get_refcounted_exception_header_from_ue): New static
	inline functions.
	* libsupc++/eh_alloc.cc (__cxxabiv1::__cxa_allocate_exception,
	__cxxabiv1::__cxa_free_exception): Use __cxa_refcounted_exception
	instead of __cxa_exception.
	* libsupc++/eh_throw.cc (__gxx_exception_cleanup,
	__cxxabiv1::__cxa_throw): Likewise.
	* libsupc++/eh_ptr.cc (std::rethrow_exception,
	std::__exception_ptr::exception_ptr::_M_addref,
	std::__exception_ptr::exception_ptr::_M_release,
	__gxx_dependent_exception_cleanup): Likewise.
	* testsuite/18_support/exception/38732.cc: New test.

From-SVN: r143170
2009-01-07 23:50:42 +01:00
Paolo Carlini 30a333ceeb [multiple changes]
2008-08-23  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/lib/libstdc++.exp (check_v3_target_atomic_builtins): Add.
	* testsuite/lib/dg-options.exp (dg-require-atomic-builtins): Likewise.
	* testsuite/18_support/exception_ptr/current_exception.cc: Use it.
        * testsuite/18_support/exception_ptr/rethrow_exception.cc: Likewise.
        * testsuite/18_support/exception_ptr/lifespan.cc: Likewise.

2008-08-23  Sebastian Redl <sebastian.redl@getdesigned.at>

	Add (again) exception propagation support as per N2179.  Feature is
	available only when _GLIBCXX_ATOMIC_BUILTINS_4 is defined.
	* libsupc++/exception_ptr.h (exception_ptr, current_exception,
        copy_exception, rethrow_exception): New file, implement exception
	propagation.
        * libsupc++/eh_ptr.cc (exception_ptr, current_exception,
        rethrow_exception, __gxx_dependent_exception_cleanup): Likewise.
        * libsupc++/unwind-cxx.h (__cxa_exception): Add reference count.
	(__cxa_dependent_exception, __cxa_allocate_dependent_exception,
        __cxa_free_dependent_exception, __get_dependent_exception_from_ue,
        __GXX_INIT_DEPENDENT_EXCEPTION_CLASS, __is_dependent_exception,
        __gxx_dependent_exception_class, __get_object_from_ue,
        __get_object_from_ambiguous_exception): Add.
        (__GXX_INIT_EXCEPTION_CLASS, __gxx_exception_class): Rename.
        (__is_gxx_exception_class): Handle dependent exceptions.
        * libsupc++/eh_arm.cc (__cxa_type_match): Likewise.
        * libsupc++/eh_call.cc (__cxa_call_unexpected): Likewise.
        * libsupc++/eh_personality.cc (__gxx_personality_*): Likewise.
        * libsupc++/eh_type.cc (__cxa_current_exception_type): Likewise.
        * libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception,
        __cxa_free_dependent_exception): Add.
        * libsupc++/eh_throw.cc (__gxx_exception_cleanup): Handle reference
        counting.
        * libsupc++/exception: Conditionally include exception_ptr.h.
        * libsupc++/Makefile.am: Register new files.
        * libsupc++/Makefile.in: Regenerate.
        * config/abi/pre/gnu.ver: Add new symbols.
        * testsuite/18_support/exception_ptr/current_exception.cc: Test the
        core functionality of current_exception().
        * testsuite/18_support/exception_ptr/rethrow_exception.cc: Test the
        core functionality of rethrow_exception().
        * testsuite/18_support/exception_ptr/lifespan.cc: Test the life span of
        exception objects during exception propagation.

From-SVN: r139509
2008-08-23 11:28:30 +00:00
Paolo Carlini 9b410dd0ec 2008-08-22 Paolo Carlini <paolo.carlini@oracle.com>
Revert again the N2179 patch.

From-SVN: r139497
2008-08-22 18:59:41 +00:00
Sebastian Redl eb5712c966 eh_ptr.cc (__gxx_dependent_exception_cleanup): Call __cxa_free_dependent_exception.
2008-08-21  Sebastian Redl <sebastian.redl@getdesigned.at>

	* libsupc++/eh_ptr.cc (__gxx_dependent_exception_cleanup): Call
	__cxa_free_dependent_exception.

From-SVN: r139402
2008-08-21 17:37:23 +00:00
Paolo Carlini 6d419a6ef3 Re-instate last patch...
2008-08-13  Paolo Carlini  <paolo.carlini@oracle.com>

	Re-instate last patch, amended to use __exchange_and_add_dispatch
	and __atomic_add_dispatch in eh_ptr.cc and eh_throw.cc.

From-SVN: r139091
2008-08-14 01:17:09 +00:00
Paolo Carlini 8d019b6593 2008-08-13 Paolo Carlini <paolo.carlini@oracle.com>
Revert the last patch.

From-SVN: r139075
2008-08-13 20:10:42 +00:00
Paolo Carlini ec001bc928 2008-08-13 Paolo Carlini <paolo.carlini@oracle.com>
Revert the last patch.

From-SVN: r139074
2008-08-13 20:08:55 +00:00
Sebastian Redl 0292e6d2bb Add exception propagation support as per N2179.
2008-08-13  Sebastian Redl <sebastian.redl@getdesigned.at>

	Add exception propagation support as per N2179.
        * libsupc++/exception_ptr.h (exception_ptr, current_exception,
        copy_exception, rethrow_exception): New file, implement exception
	propagation.
        * libsupc++/eh_ptr.cc (exception_ptr, current_exception,
        rethrow_exception, __gxx_dependent_exception_cleanup): Likewise.
        * libsupc++/unwind-cxx.h (__cxa_exception): Add reference count.
	(__cxa_dependent_exception, __cxa_allocate_dependent_exception,
        __cxa_free_dependent_exception, __get_dependent_exception_from_ue,
        __GXX_INIT_DEPENDENT_EXCEPTION_CLASS, __is_dependent_exception,
        __gxx_dependent_exception_class, __get_object_from_ue,
        __get_object_from_ambiguous_exception): Add.
        (__GXX_INIT_EXCEPTION_CLASS, __gxx_exception_class): Rename.
        (__is_gxx_exception_class): Handle dependent exceptions.
        * libsupc++/eh_arm.cc (__cxa_type_match): Likewise.
        * libsupc++/eh_call.cc (__cxa_call_unexpected): Likewise.
        * libsupc++/eh_personality.cc (__gxx_personality_*): Likewise.
        * libsupc++/eh_type.cc (__cxa_current_exception_type): Likewise.
        * libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception,
        __cxa_free_dependent_exception): Add.
        * libsupc++/eh_throw.cc (__gxx_exception_cleanup): Handle reference
        counting.
        * libsupc++/exception: Conditionally include exception_ptr.h.
        * libsupc++/Makefile.am: Register new files.
        * libsupc++/Makefile.in: Regenerate.
        * config/abi/pre/gnu.ver: Add new symbols.
        * testsuite/18_support/exception_ptr/current_exception.cc: Test the
        core functionality of current_exception().
        * testsuite/18_support/exception_ptr/rethrow_exception.cc: Test the
        core functionality of rethrow_exception().
        * testsuite/18_support/exception_ptr/lifespan.cc: Test the life span of
        exception objects during exception propagation.

From-SVN: r139064
2008-08-13 18:14:51 +00:00