https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91358
--- Comment #3 from Michael Matz <matz at gcc dot gnu.org> --- (In reply to Antony Polukhin from comment #2) > (In reply to Michael Matz from comment #1) > 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? The only way I see would be to emit the jumpy sequence that RTL generates (sometimes) from "if (x & y)" in the opposite order. There's no real reason within the intermediate form to prefer one or the other, but it might help in practice. (The problem will be that there's also no reason that would prevent GCC from transforming "x & y" into "y & x", e.g. for canonicalization, and then the other order would create the problem). > Otherwise, is there some kind of a pattern that valgrind/gdb could detect to > avoid false positives? I don't really see any, no good idea here :-/