https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80952
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> --- Yep, there's my initial attempt to do that: https://patchwork.ozlabs.org/patch/685796/ But as I discussed with Richi, he prefers more generic approach to have local counters being updated at function exits.