[Patch, 10 Regression] fortran: ICE in gfc_match_assignment PR93600
Please find attached a fix for PR93600.
This builds on the patch originally submitted to the PR by Steve Kargl,
the dreaded "Unclassifiable statement error" is replaced by the correct
error message. It would have been posted earlier had not one of the test
cases failed as a result of the fix for PR93581. A small change
(resolve.c) was necessary to fix that.
* expr.c (simplify_parameter_variable): Check whether the ref
chain contains INQUIRY_LEN or INQUIRY_KIND and set inquiry
boolean. When an empty array has been identified and a new
new EXPR_ARRAY expression has been created only return that
expression if inquiry is not set. This allows the new
expression to drop through to be simplified into a
EXPR_CONSTANT representing %kind or %len.
* matc.c (gfc_match_assignment): If lvalue doesn't have a
symtree free both lvalue and rvalue expressions and return
* resolv.c (gfc_resolve_ref): Ensure that code to handle
INQUIRY_LEN is only performed for arrays with deferred types.