aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2011-12-12 14:24:30 +0100
committerKai Tietz <ktietz@gcc.gnu.org>2011-12-12 14:24:30 +0100
commitf5c48b80ce05386d15f25859cecafbc475a21bd3 (patch)
treefb256e22db988e4e02527dbd9b878d0a9519f86b
parentb913199ea39e5027a5f4176f245fe7fef1951dcd (diff)
downloadgcc-f5c48b80ce05386d15f25859cecafbc475a21bd3.zip
gcc-f5c48b80ce05386d15f25859cecafbc475a21bd3.tar.gz
gcc-f5c48b80ce05386d15f25859cecafbc475a21bd3.tar.bz2
PR libstdc++/511135
* libsupc++/cxxabi.h (__cxxabi_dtor_type): New type. (__cxa_throw): Use it for destructor-argument. * libsupc++/eh_throw.cc (__cxa_throw): Likewise. * libsupc++/unwind-cxx.h (__cxa_exception): Change type of member exceptionDestructor to __cxxabi_dtor_type. * config/os/mingw32-w64/os_defines.h (_GLIBCXX_USE_THISCALL_ON_DTOR): Define. (__cxa_dtor_type): Declare target secific type variant. * config/os/mingw32/os_defines.h: Likewise. From-SVN: r182237
-rw-r--r--libstdc++-v3/ChangeLog13
-rw-r--r--libstdc++-v3/config/os/mingw32-w64/os_defines.h10
-rw-r--r--libstdc++-v3/config/os/mingw32/os_defines.h10
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h6
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc8
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h6
6 files changed, 43 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 72dfa7c..bf5afcd 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,16 @@
+2011-12-12 Kai Tietz <ktietz@redhat.com>
+
+ PR libstdc++/511135
+ * libsupc++/cxxabi.h (__cxxabi_dtor_type): New type.
+ (__cxa_throw): Use it for destructor-argument.
+ * libsupc++/eh_throw.cc (__cxa_throw): Likewise.
+ * libsupc++/unwind-cxx.h (__cxa_exception): Change type of member
+ exceptionDestructor to __cxxabi_dtor_type.
+ * config/os/mingw32-w64/os_defines.h (_GLIBCXX_USE_THISCALL_ON_DTOR):
+ Define.
+ (__cxa_dtor_type): Declare target secific type variant.
+ * config/os/mingw32/os_defines.h: Likewise.
+
2011-12-11 Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/xml/manual/abi.xml: Replace gcc-x.y.z with GCC x.y.z or x.y,
diff --git a/libstdc++-v3/config/os/mingw32-w64/os_defines.h b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
index c483a92..b612d06 100644
--- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h
+++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
@@ -1,7 +1,7 @@
// Specific definitions for generic platforms -*- C++ -*-
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-// 2009, 2010 Free Software Foundation, Inc.
+// 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -65,4 +65,12 @@
// ioctlsocket function doesn't work for normal file-descriptors.
#define _GLIBCXX_NO_IOCTL 1
+// See libstdc++/51135
+// Class constructors/destructors have __thiscall calling-convention
+// for IA 32-bit target.
+#if defined (__i386__)
+#define _GLIBCXX_USE_THISCALL_ON_DTOR 1
+typedef void (__thiscall *__cxa_dtor_type) (void *);
+#endif
+
#endif
diff --git a/libstdc++-v3/config/os/mingw32/os_defines.h b/libstdc++-v3/config/os/mingw32/os_defines.h
index c483a92..b612d06 100644
--- a/libstdc++-v3/config/os/mingw32/os_defines.h
+++ b/libstdc++-v3/config/os/mingw32/os_defines.h
@@ -1,7 +1,7 @@
// Specific definitions for generic platforms -*- C++ -*-
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-// 2009, 2010 Free Software Foundation, Inc.
+// 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -65,4 +65,12 @@
// ioctlsocket function doesn't work for normal file-descriptors.
#define _GLIBCXX_NO_IOCTL 1
+// See libstdc++/51135
+// Class constructors/destructors have __thiscall calling-convention
+// for IA 32-bit target.
+#if defined (__i386__)
+#define _GLIBCXX_USE_THISCALL_ON_DTOR 1
+typedef void (__thiscall *__cxa_dtor_type) (void *);
+#endif
+
#endif
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index e78f551..7ed5c55 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -51,6 +51,10 @@
#include <bits/cxxabi_tweaks.h>
#include <bits/cxxabi_forced.h>
+#ifndef _GLIBCXX_USE_THISCALL_ON_DTOR
+typedef void (*__cxa_dtor_type) (void *);
+#endif
+
#ifdef __cplusplus
namespace __cxxabiv1
{
@@ -596,7 +600,7 @@ namespace __cxxabiv1
// Throw the exception.
void
- __cxa_throw(void*, std::type_info*, void (*) (void *))
+ __cxa_throw(void*, std::type_info*, __cxa_dtor_type)
__attribute__((__noreturn__));
// Used to implement exception handlers.
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index 728c5cc..0791f1a 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -1,6 +1,6 @@
// -*- C++ -*- Exception handling routines for throwing.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-// Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -58,8 +58,8 @@ __gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
extern "C" void
-__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
- void (*dest) (void *))
+__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
+ __cxa_dtor_type dest)
{
// Definitely a primary.
__cxa_refcounted_exception *header
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index e538bde..b9919ce 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -1,6 +1,6 @@
// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+// 2011 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -51,7 +51,7 @@ struct __cxa_exception
{
// Manage the exception object itself.
std::type_info *exceptionType;
- void (*exceptionDestructor)(void *);
+ __cxa_dtor_type exceptionDestructor;
// The C++ standard has entertaining rules wrt calling set_terminate
// and set_unexpected in the middle of the exception cleanup process.