https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110816
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2023-07-26 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > The only way to access that byte is to use memcpy or via char. > -ftrivial-auto-var-init is not designed for security this way but rather for > normal code ... That's not what the manual says (emphasis mine): "Initialize automatic variables with either a pattern or with zeroes to increase the security and predictability of a program by preventing **uninitialized memory disclosure** and use." > IIRC atomic compare and swap will zero it out too ... The std::atomic and std::atomic_ref compare_exchange members will zero it, but the compiler built-in won't.