summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-08-01 09:42:36 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-08-01 09:42:36 +0400
commitd6acbda22a4f5bdf4340edacdccf01cc7e38aea8 (patch)
treef2ef982c198353d4d602f3b6ad098f3f6e11e5dd /tools
parent6605aebacb02bcce094db7a0ce07d8731b907955 (diff)
downloadbdwgc-d6acbda22a4f5bdf4340edacdccf01cc7e38aea8.tar.gz
Fix all address-of-dummy operations by adding volatile
* alloc.c (min_bytes_allocd, GC_stopped_mark): Use volatile for 'dummy' local variable (used to get 'sp' value) to prevent any harmful optimizations (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant). * dyn_load.c (GC_cond_add_roots): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * misc.c (GC_clear_stack_inner, GC_init, GC_call_with_stack_base): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, async_set_pht_entry_from_index): Likewise. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * tools/setjmp_t.c (main): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * dyn_load.c (dummy): Change variable type from char to int. * include/private/gcconfig.h: Update comment about GC_stackbottom initialization. * os_dep.c (GC_get_stack_base): Remove 'sp' local variable. * os_dep.c (GC_get_main_stack_base): Define and use volatile 'dummy' variable (instead of 'result') to get 'sp' value (revert part of commit bddc75f). * os_dep.c (GC_get_stack_base): Add missing cast of 'dummy' address (only if NEED_FIND_LIMIT). * pthread_stop_world.c (GC_suspend_handler_inner): Define and use volatile 'dummy' variable (instead of 'me') to get 'sp' value (revert part of commit 31fc0f6). * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Rename 'local_dummy' to 'dummy' local variable.
Diffstat (limited to 'tools')
-rw-r--r--tools/setjmp_t.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c
index fc54844a..b3bc2a29 100644
--- a/tools/setjmp_t.c
+++ b/tools/setjmp_t.c
@@ -69,7 +69,7 @@ int * nested_sp(void)
int main(void)
{
- int dummy;
+ volatile int dummy;
long ps = GETPAGESIZE();
jmp_buf b;
register int x = (int)strlen("a"); /* 1, slightly disguised */