GCC has a way to specify register for a local variable through usage of keywords asm and register:
register int *foo asm ("r12");
Note the quote:
The only supported use for this feature is to specify registers for
input and output operands when calling Extended asm.
This feature is used in Linux kernel on some architectures to gain access to a thread-local storage that is stored in one of general purpose registers. This is how current macro is implemented on ARC architecture:
register struct task_struct *curr_arc asm("r25");
#define current (curr_arc)
Such usage is interesting as it uses register keyword at a global scope, while in standard C it can only be used locally.