3 ms·
Is skipping initialization of buffers a hard problem for compilers?
by anon-3988 1y ago
Is skipping initialization of buffers a hard problem for compilers?
- empath75 1y agoIt's easy to not initialize the buffer, the hard part is guaranteeing that it's safe to read something that might not be initialized.
- adgjlsfhk1 1y agoyeah. Proving that the zero initialization is useless requires proving that the rest of the program never reads one of the zeroed values. This is really difficult because compilers generally don't track individual array indices (since you often don't even know how big the array is)
- brigade 1y agoIt’s especially hard to elide the compiler initialization when the intended initialization is by a function written in assembly
- mastax 1y agoIn this case I assume the difficulty is the initialization happens in assembly which the compiler has no visibility into.