This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR52864 - fix actual/formal checks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]