![]() |
Specifying Registers for Local Variables |
Previous | Variables in Specified Registers | Next |
Local register variables in specific registers do not reserve the registers. The compiler's data flow analysis is capable of determining where the specified registers contain live values, and where they are available for other uses. Stores into local register variables may be deleted when they appear to be dead according to dataflow analysis. References to local register variables may be deleted or moved or simplified.
These local variables are sometimes convenient for use with the extended
asm
feature (see the section Assembler
Instructions with C Expression Operands), if you want to write one
output of the assembler instruction directly into a particular register
(this will work provided the register you specify fits the constraints
specified for that operand in the asm
block).
You can define a local register variable with a specified register
like this:
register int *foo asm ("a5");Here
a5
is the name of the register which should be used. Note
that this is the same syntax used for defining global register
variables, but for a local variable it would appear within a function.
%a5
.
asm
statement
and assume it will always refer to this variable.