Q:

How does compiler treat an automatic variable when binary operation are involved in assignment

I would like to know if Compile (or the language) treats different a variable like:
auto unsigned int a;
a = 8;

from:
auto unsigned int a;
a = 1 << 3;

To be more precise , here a = 8 in the location of a it will be written the value 8, so there is no importance which value was there (even if there is garbage).
What I am not sure is how does exactly works in this situation a = 1 << 3.
I am sure that, inside a there is a garbage value, and if for example a == 1341 ( a garbage value ), then a = 1 << 3 results in 8.
But if 1341 in binary representation means:
00000101 00111101
then I was expecting to be 10728:
00101001 11101000.
What I am not really sure here is, does a being treated as 00000000?
In this form a gets initialized to 0 before the operation on the left is being executed?
Something like 00000000 = 1 << 3?
Where a becomes 0000 1000, or how really works in this situation?
I do understand this unsigned int a = 0, then a = a << 3 would be 8 = 0000 1000, but this is different from my Question, because here a << the operations is on a and not on 1 like in my Question.

A:

Lets go step by step for the expression  a = 1<<3

This is a simple assignment statement where lvalue should be evaluated. So 1 << 3 will be evaluated to 8 . As Both 1 and 3 are integer literals and compiler may generate a assembly instruction somewhat like ROL 1,3 --> Rotate 1 to left by 8 and store result in accumulator.
<< has higher precedance than =.

Till now we dont know where we need to store the result of above step.
As a auto variable compiler may decide to store it on a stack segment. Pseudo
instruction could be  MOV @SP+4, A --> Move data of accumulator into a location
pointed by stack pointer with offset 4.

As you said correctly a will have garbage value initially. But this does not affect the second statement.
P.S: All assembly instructions will be platform specific, Above steps are for example only.
EDIT
As pointed out by Lundin 1<<3 is integer constant expression so it will b evaluated compile time. So we may end up with a single run-time step which will be copying 8 onto stack.

