https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69702
--- Comment #2 from Arnd Bergmann <arnd at linaro dot org> --- Thanks, I have now added -fno-tree-loop-im to the kernel gcov cflags, so files we profile will be built with that. I can confirm that it fixes all stack size warnings that show up with -fprofile-arcs, I found around a dozen of them in various parts of the kernel. Are there any downsides to doing this for all compiler versions? I don't think we care much about a missed optimization when CGOV is used, and nobody ships that on production systems. I guess for older gcc releases it's not necessary to disable tree-loop-im, but it's not easy to make this conditional on the gcc version without major surgery in the kernel build system. I'm also adding -Wno-maybe-uninitialized now, because -fprofile-arcs also introduces countless "error: '...' may be used uninitialized in this function [-Werror=maybe-uninitialized]" warnings that I don't see without -fprofile-arcs, and those are all false positives. Let me know if I should open another bug report for those (I assume there isn't really much to do, based on my reading of https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings). I also found two other files in the kernel that doen't build correctly once -fprofile-arcs is enabled (with or without tree-loop-im), I'll report those as separate bugs.