GNU C allows you to put a few global variables into specified hardware registers. You can also specify the register in which an ordinary register variable should be allocated.
asm
statement and the asm
statement itself is not deleted. 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 Extended Asm), if you want to write one output of the assembler instruction directly into a particular register. (This works provided the register you specify fits the constraints specified for that operand in the asm
.)
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/Explicit-Reg-Vars.html