Remix.run Logo
anon-3988 a day ago

Is skipping initialization of buffers a hard problem for compilers?

brigade a day ago | parent | next [-]

It’s especially hard to elide the compiler initialization when the intended initialization is by a function written in assembly

adgjlsfhk1 a day ago | parent | prev | next [-]

yeah. 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)

mastax 20 hours ago | parent | prev | next [-]

In this case I assume the difficulty is the initialization happens in assembly which the compiler has no visibility into.

empath75 a day ago | parent | prev [-]

It's easy to not initialize the buffer, the hard part is guaranteeing that it's safe to read something that might not be initialized.