https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94445
--- Comment #6 from avieira at gcc dot gnu.org --- I have also identified that this only goes wrong in O2 or higher. And it happens sometime between tailcall optimization pass 1 and 2. But there's loads of passes in between.