http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55172
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot |pault at gcc dot gnu.org |gnu.org | --- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> 2013-01-02 12:34:35 UTC --- (In reply to comment #2) > I suspect the 4.8-problem of having only the ICE without a prior error message > might be due to this commit: > > http://gcc.gnu.org/viewcvs?view=revision&revision=187192 > > 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!?! This is partially correct. Unfortunately, the selector expression comes from the parser with the ar->type == AR_UNKNOWN and it was this that gfc_resolve_expr was putting right. As long as all the variables were declared or had implicit types, all was well. Th is fixed by removing the call to gfc_resolve_expr and adding explicit code, copied from resolve_array_ref, to set the correct type. It is also necessary/advisable to add a call to resolve the selector expression in resolve_select_type. I will submit a patch later today. Cheers Paul PS If the index 'i' is declared, wrong code results as in pr54990.