The same compiler (mis-)feature was also the cause of spurious crashes in Go applications (diagnosed about a month ago:
https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/). Linus's comment is fun:
So yes, It's a terminally broken compiler from hell. I assume gentoo
has applied some completely broken security patch to their compiler,
turning said compiler into complete garbage.