This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
GCC asm register clobber
- From: "Jonathan S. Shapiro" <shap at eros-os dot com>
- To: newlib at sources dot redhat dot com
- Date: Wed, 18 Jul 2007 17:19:18 -0400
- Subject: GCC asm register clobber
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?
shap