https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91358
--- Comment #2 from Antony Polukhin <antoshkka at gmail dot com> --- (In reply to Michael Matz from comment #1) > So, if you've seen a real problem somewhere (and not just valgrind > complaining about uninitialized registers in comparisons), > then you've reduced the testcase too much. The original test case was not hitting the abort. Only the valgrind was complaining. Original test case uses boost::variant, boost::optional and std::vector, so it's quite hard to analyze. Part of the assembly with two checks after the delete looks quite the same. Valgrind complains are distracting. GDB entering the destructor is missleading. Is there a simple way to change the GCC codegen to avoid the issue and not affect performance? Otherwise, is there some kind of a pattern that valgrind/gdb could detect to avoid false positives?