asm memory barrier question

Falk Hueffner hueffner@informatik.uni-tuebingen.de
Tue Mar 16 19:57:00 GMT 2004


"jhjk jhj" <mmore_benq@hotmail.com> writes:

> (code)
> asm_function-that_alters_general_purpose_registers_without_restoring_them();
> asm volatile("" : : : "memory");
> (other code)
>
> The program will break?

Yes. If you want to alter general purpose registers without restoring
them, add them to the asm's clobber list.

-- 
	Falk



More information about the Gcc mailing list