Closed
Description
There's generally no need to zero out PODs, and no need to zero out anything beyond the first pointer of a non-POD data structure containing unique values. (Drop glue can simply bail out at the first null pointer it finds.)
LLVM does not optimize out redundant zeroing out of structs, unless all functions that operate on the struct are inlined and SROA happens. Neither does GCC. I believe (but haven't thought too deeply about it) that this is probably an unsafe optimization with the semantics of C. So this could be a rather large win for code size.