Committed as obvious as r12-3533. The fix to PR87737 did work for the given testcase, but could lead to a bad internal compiler state for a variation of the testcase. (Found by Gerhard...) The solution was to not return too early after emitting the error message but going through a 'cleanup' instead. Regtested on x86_64-pc-linux-gnu, and checked the testcase also with valgrind (to be on the safer side). Thanks, Harald Fortran - fix ICE during error recovery checking entry characteristics gcc/fortran/ChangeLog: PR fortran/102311 * resolve.c (resolve_entries): Attempt to recover cleanly after rejecting mismatched function entries. gcc/testsuite/ChangeLog: PR fortran/102311 * gfortran.dg/entry_25.f90: New test.