Dear All, As noted by Janus in comment #2 of the PR, "I think the function 'copy_ts_from_selector_to_associate' comes too early (namely during parsing). It tries to resolve the target expr, which should rather wait until resolution stage!?!"
It turned out that the function of the call to gfc_resolve_expr was to fix up the selector array reference type. This has been done explicitly in this patch. Bootstraps and regtests on FC17/x86_64 - OK for trunk and 4.7? A fix for PRs 53876, 54990 and 54992 is on its way, as soon as I am back from getting some groceries :-) Cheers Paul 2013-01-02 Paul Thomas <pa...@gcc.gnu.org> PR fortran/55172 * match.c (copy_ts_from_selector_to_associate): Remove call to gfc_resolve_expr and replace it with explicit setting of the array reference type. 2013-01-02 Paul Thomas <pa...@gcc.gnu.org> PR fortran/55172 * gfortran.dg/select_type_31.f03: New test.
pr55172.diff
Description: Binary data