https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108552

--- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We could mark the __gcov* artificial vars with some flag (unless they are
already) and try to avoid using IVs loaded from those in IVOPTs, but as can be
seen above, the chosen IV really isn't that memory but an SSA_NAME that is
initialized with something loaded from that and in other cases it could be even
not that simple (say multiple copies of the same loop in sequence with a load
from __gcov* only at the beginning and then the loops just using a PRE IV
temporary for all the stores).  I bet the RA does it from similar reasons, var
isn't volatile, updated many times without any atomic barriers in between, so
if some other thread modifies it in between, it would be a data race.

Reply via email to