Procedure Pointer Components

Janus Weil jaydub66@googlemail.com
Wed Sep 3 09:36:00 GMT 2008


> It seems that you do no special trans'ing of PPC calls at the moment but
> rely on the usual trans of c->resolved_sym.  I've not really an idea about
> how this works/should work, but this seems to be the problem of your
> link-time error.  I would expect that this tries to call a symbol "ppc"
> directly, rather than calling via indirection through a function-pointer.

Of course a call to a procedure pointer should be generated. However,
there was an error (attr.proc_pointer was not set), so that a normal
function call was generated which lead to the run-time error. An
updated patch is attached.

> I would try to add a new trans method for PPC calls that does this, i.e.
> generate a call to a function-pointer.  But I don't really know if there's
> even something like this...

We have get_proc_pointer_decl (trans-decl.c), which does the
declaration of standard procedure pointers, and gfc_conv_function_call
(trans-expr.c), which also should be able to handle standard procedure
pointers.

For procedure pointer components we will probably need some more adjustments.
Probably we will also need some special handling of the f2k_derived namespace.

The current version of the patch fails on the test case posted earlier
with some nasty segmentation fault in get_frame_type (tree-nested.c),
somewhere down the line from cgraph_finalize_function.

Will try to find out more.

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: procptr_comp_139884.diff
Type: text/x-patch
Size: 25335 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080903/9b0067a0/attachment.bin>


More information about the Fortran mailing list