This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/42072] [F03] wrong-code with C_F_PROCPOINTER



------- Comment #5 from janus at gcc dot gnu dot org  2009-11-17 12:00 -------
(In reply to comment #3)
> So inside MAIN__ we have:
>   static void setpointer (integer(kind=4) (*<T3af>) (integer(kind=4)));
>   setpointer (&ptype);
> 
> That is wrong, unless I am missing a reference type somewhere.

Yes, indeed the 'static' line is wrong. However, it does not seem to have any
consequences.


> Plus inside setpointer I think:
>   p = (integer(kind=4) (*<T3af>) (integer(kind=4)) *) funpointer;
> 
> is incorrect, it should be:
> *p = funpointer;

Right, this is corrected by my patch in comment #2. With that patch, the dump
shows:


setpointer (integer(kind=4) (*<T3d4>) (integer(kind=4)) * p)
{
  *p = (integer(kind=4) (*<T3d4>) (integer(kind=4))) funpointer;
}

MAIN__ ()
{
  extern void (*<T62>) (void) funpointer;
  integer(kind=4) (*<T3d4>) (integer(kind=4)) ptype;
  integer(kind=4) (*<T3d4>) (integer(kind=4)) ptype2;
  static void setpointer (integer(kind=4) (*<T3d4>) (integer(kind=4)));

Here the 'setpointer' routine is ok, but again the static declaration is wrong.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]