[Patch, Fortran, OOP] PR 45438: [4.6 Regression] ICE with -fcheck=pointer
Janus Weil
janus@gcc.gnu.org
Mon Sep 20 22:21:00 GMT 2010
2010/9/20 Janus Weil <janus@gcc.gnu.org>:
> 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.
Regtest successful. Committed as r164462.
Cheers,
Janus
More information about the Fortran
mailing list