This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Revert gcc_unreachable changes to unwind headers
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 May 2005 18:36:11 -0700
- Subject: Revert gcc_unreachable changes to unwind headers
Nathan, this unthinking "see abort, must change" attitude has
absolutely got to stop. Did you not notice that unwind.h is
an INSTALLED, PUBLIC header file? You cannot go making API
changes like that at a whim.
Further, even if this had been a good idea, you could have stood
to test this a bit more. You might have tested ia64 at all,
since it's quite obvious that the unwind.h change is in the
middle of an #ifdef __ia64__ block. And you apparently skipped
testing objc.
I have reverted the following changes.
r~
Index: unwind.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -d -r1.17 -r1.18
--- unwind.h 30 Nov 2004 08:15:39 -0000 1.17
+++ unwind.h 17 May 2005 15:35:56 -0000 1.18
@@ -214,8 +214,7 @@ _Unwind_GetDataRelBase (struct _Unwind_C
static inline _Unwind_Ptr
_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
{
- abort ();
- return 0;
+ gcc_unreachable ();
}
/* @@@ Retrieve the Backing Store Pointer of the given context. */
Index: unwind-pe.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-pe.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -d -r1.18 -r1.19
--- unwind-pe.h 21 Jan 2004 20:40:04 -0000 1.18
+++ unwind-pe.h 17 May 2005 15:35:56 -0000 1.19
@@ -34,13 +34,6 @@
#ifndef GCC_UNWIND_PE_H
#define GCC_UNWIND_PE_H
-/* If using C++, references to abort have to be qualified with std::. */
-#if __cplusplus
-#define __gxx_abort std::abort
-#else
-#define __gxx_abort abort
-#endif
-
/* Pointer encodings, from dwarf2.h. */
#define DW_EH_PE_absptr 0x00
#define DW_EH_PE_omit 0xff
@@ -86,8 +79,9 @@ size_of_encoded_value (unsigned char enc
return 4;
case DW_EH_PE_udata8:
return 8;
+ default:
+ gcc_unreachable ();
}
- __gxx_abort ();
}
#endif
@@ -118,8 +112,9 @@ base_of_encoded_value (unsigned char enc
return _Unwind_GetDataRelBase (context);
case DW_EH_PE_funcrel:
return _Unwind_GetRegionStart (context);
+ default:
+ gcc_unreachable ();
}
- __gxx_abort ();
}
#endif
@@ -256,7 +251,7 @@ read_encoded_value_with_base (unsigned c
break;
default:
- __gxx_abort ();
+ gcc_unreachable ();
}
if (result != 0)
Index: exception.c
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/exception.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -d -r1.2 -r1.3
--- exception.c 1 Oct 2004 03:46:38 -0000 1.2
+++ exception.c 19 May 2005 12:22:21 -0000 1.3
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include "config.h"
#include "objc/objc-api.h"
+#include "tsystem.h"
#include "unwind.h"
#include "unwind-pe.h"
Index: libsupc++/unwind-cxx.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/unwind-cxx.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -d -r1.8 -r1.9
--- libsupc++/unwind-cxx.h 19 Feb 2005 02:35:25 -0000 1.8
+++ libsupc++/unwind-cxx.h 19 May 2005 06:47:50 -0000 1.9
@@ -38,6 +38,8 @@
#include <typeinfo>
#include <exception>
#include <cstddef>
+#include <cstdlib>
+#define gcc_unreachable() std::abort()
#include "unwind.h"
#pragma GCC visibility push(default)
Index: exception.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/exception.cc,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -d -r1.26 -r1.27
--- exception.cc 11 Mar 2005 04:30:18 -0000 1.26
+++ exception.cc 17 May 2005 15:37:32 -0000 1.27
@@ -19,17 +19,9 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
-// unwind-pe.h uses std::abort(), but sometimes we compile libjava
-// without libstdc++-v3. The following hack forces it to use
-// stdlib.h's abort().
-namespace std
-{
- static __attribute__ ((__noreturn__)) void
- abort ()
- {
- ::abort ();
- }
-}
+// Sometimes we compile libjava without libstdc++-v3. Therefore make
+// sure we use stdlib.h's abort().
+#define gcc_unreachable() ::abort ()
#include "unwind.h"
struct alignment_test_struct