https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66487
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #4) > Actually, I guess checking for this is more of a fit for an uninitialized > read detector such as MemorySanitizer or Valgrind memcheck. Well, AddressSanitizer should be able to do that too with some extra work, what we need is know not just when the lifetime of a variable ends, but also when it starts, and instrument those two, plus disable reusing variable stack slots when instrumenting. In the function prologue we'd then mark the variables as unavailable, not just their padding, and then when they get into scope (that is the first clobber these days), we'd mark them enabled and when they get out of scope (second clobber) mark them unavailable again. GCC7 material.