[Patch, 10 Regression] fortran: ICE in gfc_match_assignment PR93600

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Patch, 10 Regression] fortran: ICE in gfc_match_assignment PR93600

Mark Eggleston
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.

As a free gift this also fixes PR93365.

OK to commit?


     Mark Eggleston  <[hidden email]>
     Steven G. Kargl  <[hidden email]>

     PR fortran/93600
     * 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
     an error.
     * resolv.c (gfc_resolve_ref): Ensure that code to handle
     INQUIRY_LEN is only performed for arrays with deferred types.


     Mark Eggleston  <[hidden email]>

     PR fortran/93365
     PR fortran/93600
     * gfortran.dg/pr93365.f90: New test.
     * gfortran.dg/pr93600_1.f90: New test.
     * gfortran.dg/pr93600_2.f90: New test.


0001-fortran-ICE-in-gfc_match_assignment-PR93600.patch (6K) Download Attachment