I am writing a C program and using the Boehm-GC for garbage collection. The GC collects anything whose reference doesn't exist anymore. The problem is that gcc will sometimes leave pointers to memory in the registers even though those variables won't be used anymore in the program. This is a highly variable behavior depending on register pressure and program size. But this messes with the GC if a register holds a pointer to memory then that memory never gets freed. We have tried putting x=NULL to force the register to be emptied but gcc just ignores this because x is not used anymore in the program. Is there a way that gcc blackholes registers if the variable they contain won't be used in the program anymore? Without this functionality, using a garbage collector is a nightmare. Hamad