[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: [Patch, Fortran] PR52864 - fix actual/formal checks
From:       Tobias Burnus <burnus () net-b ! de>
Date:       2012-04-25 6:14:57
Message-ID: 4F979661.9000407 () net-b ! de
[Download RAW message or body]

Hello Mikael,

thanks for the review. Regarding:

Mikael Morin wrote:
> is there a reason to guard the class_pointer condition with 
> attr.class_ok in the first conditional and with CLASS_DATA(...) != 
> NULL in the two other ones? Not that it matters much, and in fact, I 
> think the patch as is is good enough for committal (yes, it is a OK). 
> I'm asking as I never know myself what is the correct, canonical way 
> to handle the class_* hell...

It's a good question what's more appropriate. My impression is that both 
is nearly identical; I frankly don't know whether what's the exact 
difference. I recall that I once had to use CLASS_DATA() != NULL to 
avoid a segfault. I don't remember whether it was the issue below or 
something different.

For an expression, CLASS_DATA () != NULL has the big advantage that one 
avoids to walk the expression: For an expr, one needs to check 
expr->symtree->n.sym but also the "ref" tree. Thus, CLASS_DATA is much 
simpler than class_ok.

Looking at my patch, I have a dummy argument (i.e. gfc_symbol) - and for 
those, one can simply access fsym->sym->attr.class_ok.

Tobias
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic