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

Janus Weil janus@gcc.gnu.org
Mon Sep 20 21:32:00 GMT 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr45438_v2.diff
Type: application/octet-stream
Size: 2894 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100920/fc6a62bc/attachment.obj>


More information about the Gcc-patches mailing list