https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
Keywords| |missed-optimization
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll add that with =single counters we apply store motion aggressively, thus
cummulate counter updates for loops. But this doesn't work for =atomic since
the counter update representation is very restrictive on optimization to
surrounding code.
IMO it would make sense to have local stack counters for =atomic and insert
the corresponding (possibly accumulated) atomic updates at earliest function
exit (or possibly not returning calls). That would of course also work
for =single and we could remove the alias-analysis "hack" we have for gcov
counters.