This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42072] [F03] wrong-code with C_F_PROCPOINTER
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2009 12:00:31 -0000
- Subject: [Bug fortran/42072] [F03] wrong-code with C_F_PROCPOINTER
- References: <bug-42072-16146@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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