* misc.c (GC_call_with_stack_base): Call GC_noop1 after fn()
invocation to prevent a tail-call optimization.
{
volatile int dummy;
struct GC_stack_base base;
+ void *result;
base.mem_base = (void *)&dummy;
# ifdef IA64
/* Unnecessarily flushes register stack, */
/* but that probably doesn't hurt. */
# endif
- return fn(&base, arg);
+ result = fn(&base, arg);
+ /* Strongly discourage the compiler from treating the above */
+ /* as a tail call. */
+ GC_noop1((word)(&base));
+ return result;
}
#ifndef THREADS