diff options
author | Miguel de Icaza <miguel@gnome.org> | 2005-06-17 23:40:10 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2005-06-17 23:40:10 +0400 |
commit | a121bd210e2c565e03b1eb183eb86d4245c9ca2a (patch) | |
tree | 618f77b578c4ba9f008a245a96edf6afb65eac7f | |
parent | 354e6526a60c5081f3eab43a362272ba75239589 (diff) |
Backport to 1-1-7 branch\n 2005-06-17 Zoltan Varga <vargaz@freemail.hu>
* pthread_support.c: Workaround gcc-3.3 compiler bug.
svn path=/branches/mono-1-1-7/mono/; revision=46169
-rw-r--r-- | libgc/ChangeLog | 3 | ||||
-rw-r--r-- | libgc/pthread_support.c | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/libgc/ChangeLog b/libgc/ChangeLog index 13335fe8251..c28db34fd3f 100644 --- a/libgc/ChangeLog +++ b/libgc/ChangeLog @@ -1,3 +1,6 @@ +2005-06-17 Zoltan Varga <vargaz@freemail.hu> + + * pthread_support.c: Workaround gcc-3.3 compiler bug. Tue May 3 16:28:26 CEST 2005 Paolo Molaro <lupus@ximian.com> diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 8b47b4d3db8..5486d686e43 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -556,6 +556,27 @@ GC_bool GC_thr_initialized = FALSE; volatile GC_thread GC_threads[THREAD_TABLE_SZ]; +/* + * gcc-3.3.6 miscompiles the &GC_thread_key+sizeof(&GC_thread_key) expression so + * put it into a separate function. + */ +# ifdef __GNUC__ +static __attribute__((noinline)) unsigned char* get_gc_thread_key_addr GC_PROTO((void)) +{ + return (unsigned char*)&GC_thread_key; +} + +void GC_push_thread_structures GC_PROTO((void)) +{ + GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads)); +# if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL) + GC_push_all((ptr_t)get_gc_thread_key_addr(), + (ptr_t)(get_gc_thread_key_addr())+sizeof(&GC_thread_key)); +# endif +} + +#else + void GC_push_thread_structures GC_PROTO((void)) { GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads)); @@ -565,6 +586,8 @@ void GC_push_thread_structures GC_PROTO((void)) # endif } +#endif + #ifdef THREAD_LOCAL_ALLOC /* We must explicitly mark ptrfree and gcj free lists, since the free */ /* list links wouldn't otherwise be found. We also set them in the */ |