https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143
--- Comment #5 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> --- It's fixed by adding "-freorder-blocks-algorithm=simple" which overrides "-freorder-blocks-algorithm=stc" from "-O2".