--- gforth/engine/forth.h 2002/08/28 17:50:29 1.29 +++ gforth/engine/forth.h 2002/09/14 08:34:03 1.30 @@ -166,12 +166,12 @@ typedef Label *Xt; #endif /* !defined(DOUBLY_INDIRECT) */ #ifdef GFORTH_DEBUGGING -/* #define NAME(string) saved_ip=ip;*/ -#define NAME(string) *(Cell *)&saved_ip=(Cell)ip; -/* the casting is there to get aliasing with loads at the start of the - primitives, so the store is not moved down across them; does not - work for FP-stack loads; ideally the -fno-strict-aliasing flag - should do this for us, but at least in gcc-2.95 it does not */ +#define NAME(string) { saved_ip=ip; asm(""); } +/* the asm here is to avoid reordering of following stuff above the + assignment; this is an old-style asm (no operands), and therefore + is treated like "asm volatile ..."; i.e., it prevents most + reorderings across itself. We want the assignment above first, + because the stack loads may already cause a stack underflow. */ #elif DEBUG # define NAME(string) fprintf(stderr,"%08lx: "string"\n",(Cell)ip); #else