public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function
Date: Sun, 25 Oct 2009 14:33:00 -0000	[thread overview]
Message-ID: <20091025143313.30319.qmail@sourceware.org> (raw)
In-Reply-To: <bug-41777-13404@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from burnus at gcc dot gnu dot org  2009-10-25 14:33 -------
  print *, associated(a,f(a)) ! Valid, but error

If one steps in the debugger, one see that the TARGET= argument of associate
but "f", i.e. target->expr_type == EXPR_FUNCTION, target->symtree->n.sym->name
"f" and target->value.function->esym->name == "f".

Patch - not regtested, but seems to work.

--- resolve.c   (Revision 153537)
+++ resolve.c
@@ -1867,6 +1867,11 @@ resolve_generic_f0 (gfc_expr *expr, gfc_
        {  
          expr->value.function.name = s->name;
          expr->value.function.esym = s;
+         /* Copy attributes such that checking attr.pointer works, but keep
+            attr.generic as we do not (want to) copy all the other properties
+            of the specific.  */
+         expr->symtree->n.sym->attr = s->attr;
+         expr->symtree->n.sym->attr.generic = 1;
          if (s->ts.type != BT_UNKNOWN)
            expr->ts = s->ts;


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-10-25 14:33:13
               date|                            |


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


  parent reply	other threads:[~2009-10-25 14:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21  8:41 [Bug fortran/41777] New: wrong-code shown with EXCITING burnus at gcc dot gnu dot org
2009-10-21  9:11 ` [Bug fortran/41777] " burnus at gcc dot gnu dot org
2009-10-21  9:12 ` burnus at gcc dot gnu dot org
2009-10-21  9:22 ` [Bug fortran/41777] wrong-code with FoX, related to ASSOCIATE( Ptr1, Ptr2) burnus at gcc dot gnu dot org
2009-10-21 12:09 ` [Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function burnus at gcc dot gnu dot org
2009-10-25 14:33 ` burnus at gcc dot gnu dot org [this message]
2009-10-25 14:44 ` burnus at gcc dot gnu dot org
2009-10-25 18:34 ` dominiq at lps dot ens dot fr
2009-10-28 10:18 ` burnus at gcc dot gnu dot org
2009-10-28 10:38 ` burnus at gcc dot gnu dot org
2009-10-28 15:03 ` burnus at gcc dot gnu dot org
2009-10-28 15:47 ` burnus at gcc dot gnu dot org
2009-10-28 16:27 ` dominiq at lps dot ens dot fr
2009-10-29 15:25 ` burnus at gcc dot gnu dot org
2009-10-29 15:28 ` burnus at gcc dot gnu dot org
2009-10-29 16:44 ` burnus at gcc dot gnu dot org
2009-10-30 15:18 ` burnus at gcc dot gnu dot org
2009-11-27 14:28 ` mrestelli at gmail dot com
2010-02-02 10:00 ` burnus at gcc dot gnu dot org
2010-02-02 10:00 ` burnus at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091025143313.30319.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).