http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46484
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #3 from kargl at gcc dot gnu.org 2010-11-15 16:48:24 UTC --- (In reply to comment #2) > (In reply to comment #1) > > Longer test case is gfortran.dg/allocatable_scalar_5.f90 (cf. 46485). > > PR 46485 > > > Mark as 4.5/4.6 regression. It is not true regression as 4.3/4.4 rejected it > with "just" with > Internal Error at (1): > gfc_variable_attr(): Expression isn't a variable > but still ... > > The reason for the failure is that check.c's variable_check accepts: > || (e->expr_type == EXPR_FUNCTION > > which at a glance does not make sense. Currently, I can only imagine a Fortran > 2008 case, which allows pointer-returning functions in place of variables. Cf. > PR 40054 (and PR 46100). > I think you may have trimmed too much of the condition. || (e->expr_type == EXPR_FUNCTION && e->symtree->n.sym->result == e->symtree->n.sym)) Doesn't the second part apply to RESULT variables, ie., funtion foo(x) result(this_should_be_a_variable(not_a function)) I haven't checked if this where it would apply.