When defining a variable in the following manner:
static register int a1 = 0;
we get the error:
error: multiple storage classes in declaration specifiers
Is there any fundamental reason for this error? Why can't a variable be both stored in a register, and also be initialized only at start up/first call? It is possible to attach the register storage class to a global variable. <- edit: not true
If a compiler implemented what you wanted faithfully then it would tie up a CPU register for the length of your program. That's hardly practical.
Remember that register
is only advisory.