[Patch, Fortran, OOP] PR 45438: [4.6 Regression] ICE with -fcheck=pointer

Mikael Morin mikael.morin@sfr.fr
Mon Sep 20 21:27:00 GMT 2010


On Monday 20 September 2010 22:34:19 Janus Weil wrote:
> Hi Mikael,
> 
> >> Index: gcc/fortran/trans-expr.c
> >> ===================================================================
> >> --- gcc/fortran/trans-expr.c  (revision 164445)
> >> +++ gcc/fortran/trans-expr.c  (working copy)
> >> @@ -3169,27 +3169,30 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol
> >> *
> >> 
> >>        if (gfc_option.rtcheck & GFC_RTCHECK_POINTER && e != NULL)
> >> 
> >>          {
> >> 
> >> -       symbol_attribute *attr;
> >> +       symbol_attribute attr;
> >> 
> >>         char *msg;
> >>         tree cond;
> >> 
> >>         if (e->expr_type == EXPR_VARIABLE)
> >> 
> >> -         attr = &e->symtree->n.sym->attr;
> >> +         attr = e->symtree->n.sym->attr;
> >> 
> >>         else if (e->expr_type == EXPR_FUNCTION)
> >> 
> >>           {
> >> 
> >>             /* For intrinsic functions, the gfc_attr are not available.
> >>  */ if (e->symtree->n.sym->attr.generic && e->value.function.isym)
> >> 
> >>               goto end_pointer_check;
> >> 
> >> -           if (e->symtree->n.sym->attr.generic)
> >> -             attr = &e->value.function.esym->attr;
> >> +           if (e->ref)
> >> +             /* TBPs & PPCs.  */
> >> +             attr = gfc_expr_attr (e);
> > 
> > Would it be possible to use gfc_expr_attr in all cases ?
> 
> Actually I'm not sure. But probably we should use it at least for
> EXPR_VARIABLE (otherwise POINTER components etc will not work). I'm
> now regtesting the attached variant and will commit if there are no
> failures.
> 
> Thanks for the review ...
> 
> Cheers,
> Janus

Thanks



More information about the Fortran mailing list