http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55827



--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 
2012-12-29 16:04:45 UTC ---

On Fri, Dec 28, 2012 at 10:02:43PM +0000, kargl at gcc dot gnu.org wrote:

> 

> Index: class.c

> ===================================================================

> --- class.c     (revision 194745)

> +++ class.c     (working copy)

> @@ -162,7 +162,8 @@ gfc_fix_class_refs (gfc_expr *e)

>    if ((e->expr_type != EXPR_VARIABLE

>         && e->expr_type != EXPR_FUNCTION)

>        || (e->expr_type == EXPR_FUNCTION

> -         && e->value.function.isym != NULL))

> +         && e->value.function.isym != NULL)

> +      || e->symtree == NULL)

>      return;

> 

>    ts = &e->symtree->n.sym->ts;

> Index: trans-expr.c

> ===================================================================

> --- trans-expr.c        (revision 194745)

> +++ trans-expr.c        (working copy)

> @@ -5527,7 +5527,7 @@ gfc_conv_function_expr (gfc_se * se, gfc

> 

>    /* We distinguish statement functions from general functions to improve

>       runtime performance.  */

> -  if (expr->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)

> +  if (expr->symtree && expr->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)

>      {

>        gfc_conv_statement_function (se, expr);

> 



Although I agree with Mikael that gfortran should probably

not have a NULL symtree by the time we reach gfc_conv_function_expr,

the above patch regression tests cleanly.

Reply via email to