PROCEDURE pointers

Janus Weil jaydub66@googlemail.com
Tue Aug 28 18:00:00 GMT 2007


Hi all,
since my patch for PROCEDURE declarations is reasonably stable now
(hopefully), we could try to get procedure pointers working as well.
But I think I will need some help with this, if it should be included
in 4.3.
So if anyone cares to take a look at it: Attached is my procedure
declaration patch, which should provide the basis for the PROCEDURE
syntax, plus an early version of a procedure pointer patch, which is
just the pointer bits extracted from Paul's first attempt to implement
procedure statements (mainly dealing with pointer assignment).
Paul already told me that this is not really working yet, but probably
it's not a lot of work to get procedure pointers working for someone
with a better knowledge of the middle-end mechanisms than me. It would
be great if someone could look into it.
To try out the procedure pointer implementation, you just need to
apply both patches, and in addition remove the following lines in
decl.c (gfc_match_procedure):

  if (current_attr.pointer)
    {
      gfc_error ("Procedure pointers used at %C are not yet implemented");
      return MATCH_ERROR;
    }

As said before it's not fully working yet, but hopefully not far from
it. The syntax bits should be ok, only the pointer assignments seem to
be broken.
I also attached two files with example code. For the first one I get
the following error:

ppt1a.f90:13: internal compiler error: in gimplify_expr, at gimplify.c:6203

For the second one I get this:

ppt1b.f90:(.text+0x23): undefined reference to `p.1025'
ppt1b.f90:(.text+0x5e): undefined reference to `p.1025'
ppt1b.f90:(.text+0x92): undefined reference to `p.1025'
ppt1b.f90:(.text+0xcd): undefined reference to `p.1025'
collect2: ld returned 1 exit status

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: procdecl127848.diff
Type: text/x-patch
Size: 14243 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070828/411f118e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: procptr127848.diff
Type: text/x-patch
Size: 4722 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070828/411f118e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppt1a.f90
Type: text/x-fortran
Size: 342 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070828/411f118e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppt1b.f90
Type: text/x-fortran
Size: 380 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070828/411f118e/attachment-0003.bin>


More information about the Fortran mailing list