https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84245
kargls at comcast dot net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargls at comcast dot net --- Comment #13 from kargls at comcast dot net --- (In reply to Paul Thomas from comment #12) > Created attachment 59753 [details] > Fix for this PR > > Testcase. Regressions tests OK. Will submit when my tree is cleared of other > work. > > ! { dg-do compile } > ! > ! Fix ICEs caused by patch for PR78026 > ! > ! Contributed by Gerhard Steinmetz <gs...@t-online.de> > ! > module m > contains > ! z04, z06-z10 and z12-z16 were all variants, picked up by the errors below. > subroutine z01 > select type (x%a) ! { dg-error "nonderived-type variable" } > end select ! { dg-error "Expecting END SUBROUTINE" } > end > subroutine z02 > select type (x% ! { dg-error "nonderived-type variable" } > end select ! { dg-error "Expecting END SUBROUTINE" } > end > subroutine z03 > select type (x%& ! { dg-error "nonderived-type variable" } > end select > end > subroutine z05 > select type (x( ! { dg-error "Syntax error" } > end select ! { dg-error "Expecting END SUBROUTINE" } > end > subroutine z11 > select type (x[1] ! { dg-error "not a coarray" } > end select ! { dg-error "Expecting END SUBROUTINE" } > end > end module If something goes wrong, do you possibly need to free expr1 and expr2. Elsewhere in gfc_match_select_type() one seems the the idiom if (...) { m = MATCH_ERROR; goto cleanup; }