https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88902
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The problem is that gfc_add_decl_to_parent_function is called multiple times on <var_decl 0x7ffff7ffbab0 ..__result> and thus for that VAR_DECL DECL_CHAIN (decl) == decl (or in theory there could be longer loop, but any loop in DECL_CHAIN is invalid).