Good question! You actually don't need to allocate registers, but that means you'll be writing your variable's values directly into memory. This is really slow and compiler writers try their best to not let things "spill out" of registers and into memory.
It’s not the slowest thing as long as you still hit the L1 cache. x86 has so few general purpose registers that it is hard to avoid spilling into memory.
0
u/[deleted] May 24 '20
[deleted]