This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix 64-bit eh for objc
- From: Eric Christopher <echristo at apple dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Sep 2006 16:23:03 -0700
- Subject: Re: [patch] fix 64-bit eh for objc
- References: <200609190140.k8J1ejV3010442@earth.phy.uc.edu> <450F4EE8.2010807@apple.com>
I'll post another patch a bit later.
And here we go.
Tested on x86_64-darwin, ppc64-darwin, x86_64-linux and arm-elf with no
regressions.
OK?
-eric
2006-09-19 Eric Christopher <echristo@apple.com>
* doc/tm.texi (OBJC_JBLEN): Describe.
* config/i386/darwin.h (OBJC_JBLEN): Define.
* config/rs6000/darwin.h: Ditto.
2006-09-19 Eric Christopher <echristo@apple.com>
* objc-act.c (JBLEN): Rename to OBJC_JBLEN,
default to something innocuous.
(build_next_objc_exception_stuff): Rename JBLEN.
Index: doc/tm.texi
===================================================================
--- doc/tm.texi (revision 117048)
+++ doc/tm.texi (working copy)
@@ -9915,3 +9915,8 @@ This macro determines whether to use the
classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
@end defmac
+
+@defmac OBJC_JBLEN
+This macro determines the size of the objective C jump buffer for the
+NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
+@end defmac
Index: objc/objc-act.c
===================================================================
--- objc/objc-act.c (revision 117048)
+++ objc/objc-act.c (working copy)
@@ -3953,19 +3953,16 @@ objc_build_synchronized (location_t star
struct _objc_exception_data
{
- int buf[JBLEN];
+ int buf[OBJC_JBLEN];
void *pointers[4];
}; */
/* The following yuckiness should prevent users from having to #include
<setjmp.h> in their code... */
-#ifdef TARGET_POWERPC
-/* snarfed from /usr/include/ppc/setjmp.h */
-#define JBLEN (26 + 36 + 129 + 1)
-#else
-/* snarfed from /usr/include/i386/{setjmp,signal}.h */
-#define JBLEN 18
+/* Define to a harmless positive value so the below code doesn't die. */
+#ifndef OBJC_JBLEN
+#define OBJC_JBLEN 18
#endif
static void
@@ -3976,9 +3973,9 @@ build_next_objc_exception_stuff (void)
objc_exception_data_template
= start_struct (RECORD_TYPE, get_identifier (UTAG_EXCDATA));
- /* int buf[JBLEN]; */
+ /* int buf[OBJC_JBLEN]; */
- index = build_index_type (build_int_cst (NULL_TREE, JBLEN - 1));
+ index = build_index_type (build_int_cst (NULL_TREE, OBJC_JBLEN - 1));
field_decl = create_field_decl (build_array_type (integer_type_node, index),
"buf");
field_decl_chain = field_decl;
Index: config/i386/darwin.h
===================================================================
--- config/i386/darwin.h (revision 117048)
+++ config/i386/darwin.h (working copy)
@@ -37,6 +37,9 @@ Boston, MA 02110-1301, USA. */
#endif
#endif
+/* Size of the Obj-C jump buffer. */
+#define OBJC_JBLEN ((TARGET_64BIT) ? ((9 * 2) + 3 + 16) : (18))
+
#undef TARGET_FPMATH_DEFAULT
#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387)
Index: config/rs6000/darwin.h
===================================================================
--- config/rs6000/darwin.h (revision 117048)
+++ config/rs6000/darwin.h (working copy)
@@ -40,6 +40,9 @@
#define TARGET_OBJECT_FORMAT OBJECT_MACHO
+/* Size of the Obj-C jump buffer. */
+#define OBJC_JBLEN ((TARGET_64BIT) ? (26*2 + 18*2 + 129 + 1) : (26 + 18*2 + 129 + 1))
+
/* We're not ever going to do TOCs. */
#define TARGET_TOC 0