[clang] [clang][CodeGen] Zero init unspecified fields in initializers in C (PR #97121)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 13:59:11 PDT 2024


efriedma-quic wrote:

> the baseline code generation uses memset over the entire union when the size is large

That looks like an unintended side-effect of CheckAggExprForMemSetUse: it's supposed to check how much of the initialization is non-zero, but it's assuming all padding needs to be zeroed.  Which we weren't explicitly doing before, but I guess it's convenient here. And given nobody has filed a bug report for this (I think?), it doesn't seem this memset is causing significant issues for anyone.

https://github.com/llvm/llvm-project/pull/97121


More information about the cfe-commits mailing list