https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151
--- Comment #8 from Sebastian Huber <sebastian.hu...@embedded-brains.de> --- (In reply to Eric Botcazou from comment #7) > > I still think that the profiling counter increment in the > > __builtin_unreachable() path is a bug. > > How so? I only see a missed optimization, but with -fprofile-arcs > -ftest-coverage you're splitting hairs IMO. The __builtin_unreachable() explicitly mentions the use case with a function which doesn't return in the documentation: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html I would expect from the compiler that it generates then similar code. Having a profiling counter increment in one case and not in the other is not really a nice behaviour.