https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67212
--- Comment #2 from Tim Shen <timshen at gcc dot gnu.org> --- This isn't an "infinite" recursion, but just a deep one. I haven't implement heap allocation and manual recursion yet. In the mean time, you may compile your code with -O2 (tail recursion elimination may help), set a larger stack size, or use -fsplit-stack.