This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix ARM EABI forced unwinding bugs
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Fri, 10 Nov 2006 14:25:00 +0000 (UTC)
- Subject: Fix ARM EABI forced unwinding bugs
This patch fixes some problems with C++ forced unwinding in the
__ARM_EABI_UNWINDER__ case:
* empty_exception_spec needs to be added to the list of functions with
a special implementation in this case: the default implementation
isn't suited to the different type table layout used for
__ARM_EABI_UNWINDER__. (This bug causes g++.dg/eh/forced4.C to fail
in some cases.)
* __cxxabiv1::__cxa_get_globals must initialize an extra structure
member present in the __ARM_EABI_UNWINDER__ case. (This bug causes
the glibc test nptl/tst-cancel24 to fail.)
Tested arm-linux-gnueabi. OK to commit?
2006-11-10 Joseph Myers <joseph@codesourcery.com>
* libsupc++/eh_globals.cc (__cxxabiv1::__cxa_get_globals):
Initialize propagatingExceptions if __ARM_EABI_UNWINDER__.
* libsupc++/eh_personality.cc (empty_exception_spec): Define
separately in __ARM_EABI_UNWINDER__ case.
Index: libstdc++-v3/libsupc++/eh_globals.cc
===================================================================
--- libstdc++-v3/libsupc++/eh_globals.cc (revision 118630)
+++ libstdc++-v3/libsupc++/eh_globals.cc (working copy)
@@ -140,6 +140,9 @@
g = static_cast<__cxa_eh_globals*>(v);
g->caughtExceptions = 0;
g->uncaughtExceptions = 0;
+#ifdef __ARM_EABI_UNWINDER__
+ g->propagatingExceptions = 0;
+#endif
}
}
else
Index: libstdc++-v3/libsupc++/eh_personality.cc
===================================================================
--- libstdc++-v3/libsupc++/eh_personality.cc (revision 118630)
+++ libstdc++-v3/libsupc++/eh_personality.cc (working copy)
@@ -192,6 +192,17 @@
} \
while (0)
+// Return true if the filter spec is empty, ie throw().
+
+static bool
+empty_exception_spec (lsda_header_info *info, _Unwind_Sword filter_value)
+{
+ const _Unwind_Word* e = ((const _Unwind_Word*) info->TType)
+ - filter_value - 1;
+
+ return *e == 0;
+}
+
#else
typedef const std::type_info _throw_typet;
@@ -312,8 +323,6 @@
#define CONTINUE_UNWINDING return _URC_CONTINUE_UNWIND
-#endif // !__ARM_EABI_UNWINDER__
-
// Return true if the filter spec is empty, ie throw().
static bool
@@ -326,6 +335,8 @@
return tmp == 0;
}
+#endif // !__ARM_EABI_UNWINDER__
+
namespace __cxxabiv1
{
--
Joseph S. Myers
joseph@codesourcery.com