[Fortran, Patch] PR 33917 - PROCEDURE(proc-interface) - ensure proc-interface is resolved

Tobias Burnus burnus@net-b.de
Sat Oct 27 15:34:00 GMT 2007


Hi all, hi Janus and Thomas,

:ADDPATCH fortran:

Currently,

  ! sub be a procedure with an explicit interface
  procedure(sub) :: p4
  procedure(p4) :: p6

fails if the symbol p6 is resolved before p4 as then
p6->interface->attr.if_source is IFSRC_UNKNOWN.

Whether it fails, depends how one walks the symbol tree. See PR33917 for
an example which fails, unless you comment a line.

The following patch simply checks whether the proc-interface symbol in
"PROCEDURE([proc-interface])" has already a non-NULL sym->interface and,
if yes, it uses it then instead of using "sym" itself.

I think in terms of copying attributes this should be ok; however, I
would not mind if you try to come up with a reason why this is wrong
(wrong/missing attributes, memory leak, ...) or whether there is still a
case for which it will (still) fail.

Do you would like to see a comment above the added line or is its
meaning clear?

Built and regression tested on x86-64-linux.
OK for the trunk?

Tobias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: interface.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071027/a74fe391/attachment.ksh>


More information about the Fortran mailing list