------- Comment #1 from domob at gcc dot gnu dot org  2008-11-16 09:27 -------
Daniel Kraft wrote:
> > I'm working out a test-case for PR 37779 and came across the following
> > program, which ICEs for today's trunk gfortran:
> >
> >   SUBROUTINE test ()
> >     IMPLICIT NONE
> >     procptr => test
If one moves the procedure-pointer declaration in the subroutine, it
works. The difference of the -fdump-tree-original/gimple is:

+   void (*<T62>) (void) procptr;

The failing assert in make_decl_rtl is:

  /* 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));


> > Is this already a known bug?  Sorry that I don't have an overview... 
> > If not, I'll file a report.
Please do so, I think it is not known.


By the way, the following also fails:

module m
procedure(), pointer :: procptr
end module m

use m
external foo
procptr => foo
end

with Error: 'procptr' in the pointer assignment at (1) cannot be an
l-value since it is a procedure

I think the "proc_ptr" attribute is not properly saved in the .mod file.


Tobias


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38152

Reply via email to