https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108552
--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Richard Biener from comment #25) > Ah, reading more comments, no - it probably doesn't. Jakub correctly says > that there seems to be a data race necessary to trigger this, so it doesn't > seem to be a GCC issue? Well, we could in -fprofile-update=single (or perhaps in a new single-like mode) mark the gcov artificial vars volatile or with some flag that would at least cause reload not to reread values from memory. The profiling would be still racy, but at the expense of somewhat slower code (with volatile more, with special flag less so) slightly less so (as it would e.g. prevent the compiler from avoiding the rereads).