GCC asm register clobber

Jonathan S. Shapiro shap@eros-os.com
Wed Jul 18 21:47:00 GMT 2007

This is properly a question for the GCC list, but I am hoping somebody
here will know the answer.

I need to write an inline asm where a particular register is required as
an input, but has been clobbered to an undefined state at the output.
The question is: how do I express this? Is there a way to do it without
adding a dummy volatile output variable?

GCC will not let me add the register to the clobbered list, because it
is used as an input. GCC also will not let me annotate an input
constraint using '&', '+', or '='.

I'm sure there is a way to do this, and I'm just not seeing it. Can
anybody help me out?


More information about the Newlib mailing list