The memory isn't allocated at the time of compilation, but at runtime.
The compiler just generated machine code that will execute your program, actual allocations happen at runtime.
In this case the variable isn't used and there won't emitted any code for it.