|
|
|
|
|
by Brian_K_White
873 days ago
|
|
The declaration didn't reserve the address? What else is the point of having a declaration? I don't think accepting the random initial value means that the value may continue to change until the first time you set a value. |
|
Weird things happen to uninitialized variables during optimization. Basically, nothing can be assumed about the value, because using an uninitialized variable results in undefined behavior. The original un-optimized generated code may very well have some default value, maybe. Probably not. But, the optimizer can decide that this value is represented by register R0 here and R4 there, and since the variable is uninitialized, there's no point in doing a spill or a load. It really comes down to how the optimization passes were written.