https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301
--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> --- Looking at -fdump-tree-all-all, things are fine with "foo" until the switchlower pass. Before that all nine switch cases and the default case all had probability 0.10; after the switch conversion there are many basic blocks with "Invalid sum of incoming counts", and not everything has the same probability any more.