* misc.c (GC_clear_stack): Declare "dummy" local array as volatile to
prevent optimizing it out by compiler; add cast of "dummy" to void*
(to un-volatile the pointer) in BZERO call (only if THREADS).
{
ptr_t sp = GC_approx_sp(); /* Hotter than actual sp */
# ifdef THREADS
- word dummy[SMALL_CLEAR_SIZE];
+ word volatile dummy[SMALL_CLEAR_SIZE];
static unsigned random_no = 0;
/* Should be more random than it is ... */
/* Used to occasionally clear a bigger */
/* implementations of GC_clear_stack_inner. */
return GC_clear_stack_inner(arg, limit);
} else {
- BZERO(dummy, SMALL_CLEAR_SIZE*sizeof(word));
+ BZERO((void *)dummy, SMALL_CLEAR_SIZE*sizeof(word));
return arg;
}
# else