Procedure Pointers: a first patch

Janus Weil jaydub66@googlemail.com
Thu May 8 22:17:00 GMT 2008


2008/5/8 Paul Richard Thomas <paul.richard.thomas@gmail.com>:
>  >  > > For your test case, otoh, I get an ADDR_EXPR on the rhs
>
>  Yes, of course - the pointer assignment does that.

I guess what Steven meant was that there is an ADDR_EXPR on the *left*
hand side, which of course should not be there (the right hand side
also has one, but this is fine).

I identified the place where this extra ADDR_EXPR is inserted
(gfc_conv_variable, as mentioned earlier), and replaced it by
something that I hope should do the right thing (patch attached).

This new patch at least passes the gimplification, but then something
goes wrong somewhere inside cgraph_finalize_function. The error
message is:

procptr.f90:20: internal compiler error: in make_decl_rtl, at varasm.c:1297

which means the following assertion fails:

  /* A weak alias has TREE_PUBLIC set but not the other bits.  */
  gcc_assert (TREE_CODE (decl) != VAR_DECL
	      || TREE_STATIC (decl)
	      || TREE_PUBLIC (decl)
	      || DECL_EXTERNAL (decl)
	      || DECL_REGISTER (decl));

I'm not quite sure what this does or why it fails, but I guess
make_decl_rtl is only called with either VAR_DECL or FUNCTION_DECL. So
this assert must be failing on a FUNCTION_DECL, right?

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


More information about the Fortran mailing list