Fortran: fix rank/shape check in interface checking [PR124567]
PR fortran/124567
gcc/fortran/ChangeLog:
* interface.cc (gfc_check_dummy_characteristics): Split shape check
into a separate check for rank and a check for shape, taking into
account a corner case where the ambiguity between deferred shape
and assumed shape has not been fully resolved at the time of
checking.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr124567.f90: New test.
* gfortran.dg/proc_decl_30.f90: Likewise.