public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sfilippone at uniroma2 dot it" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43945] [OOP] Derived type with GENERIC: resolved to the wrong specific TBP
Date: Fri, 25 Jun 2010 15:32:00 -0000	[thread overview]
Message-ID: <20100625153154.5649.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43945-13404@http.gcc.gnu.org/bugzilla/>



------- Comment #22 from sfilippone at uniroma2 dot it  2010-06-25 15:31 -------
(In reply to comment #21)
Ok, I bit the bullet, and fooled around with the internals to see what was
happening. I did a very naive thing of adding warnings in
resolve.c:resolve_typebound_generic_call, and I think I have found at least one
thing differentiating generic_23 from test_coo above (this is the static
example, not the allocatable one). The "fixed name" thing comes from the
snippet of code
 success:
  /* Make sure that we have the right specific instance for the name.  */
  genname = e->value.compcall.tbp->u.specific->name;

---------------------------
[sfilippo@donald bug15]$ gfortran -c  test_coo.f03 
Warning: Matched Name: '---' genname 'allocate' 
Warning: Fixed Name: '---' genname 'base_allocate_mnnz' 
---------------------------------
As you can see, the name is resolved to the specific procedure. The declaration
was 
 type  :: base_sparse_mat
    integer, private     :: m, n
    integer, private     :: state, duplicate 
    logical, private     :: triangle, unitd, upper, sorted
  contains 

    procedure, pass(a) :: get_fmt => base_get_fmt
    procedure, pass(a) :: set_null => base_set_null
    procedure, pass(a) :: allocate_mnnz => base_allocate_mnnz
    generic,   public  :: allocate => allocate_mnnz
  end type base_sparse_mat

So the generics resolution is homing in to the procedure name. 
However my copy of the Fortran 2003 handbook says (at pages 95-97):
1. Specifinc bindings: 
PROCEDURE [ [,NON-OVERRIDABLE] [, binding-attribute-list] ::] binding-name [ =>
procedure-name ]
2. Generic bindings: 
GENERIC [ , access-spec ] :: generic-spec => binding-name-list

Looks to me the existing mechanism is NOT doing the correct thing, as it should
home on the BINDING-NAME (allocate_mnnz) and not on the procedure name
(base_allocate_mnnz) 

Hope this will help in fixing this thing; as of now, I have no idea if this is
related to the allocatable case (see my attachment generic_23_1) 

Salvatore 


-- 


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


  parent reply	other threads:[~2010-06-25 15:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  9:25 [Bug fortran/43945] New: " burnus at gcc dot gnu dot org
2010-04-30  9:25 ` [Bug fortran/43945] " sfilippone at uniroma2 dot it
2010-04-30  9:36 ` burnus at gcc dot gnu dot org
2010-04-30  9:42 ` sfilippone at uniroma2 dot it
2010-04-30  9:43 ` sfilippone at uniroma2 dot it
2010-04-30  9:43 ` sfilippone at uniroma2 dot it
2010-04-30 14:33 ` pault at gcc dot gnu dot org
2010-05-01 17:17 ` pault at gcc dot gnu dot org
2010-05-05 21:05 ` pault at gcc dot gnu dot org
2010-06-06  2:04 ` janus at gcc dot gnu dot org
2010-06-06  2:29 ` janus at gcc dot gnu dot org
2010-06-06  2:49 ` janus at gcc dot gnu dot org
2010-06-06  3:03 ` janus at gcc dot gnu dot org
2010-06-06 16:21 ` janus at gcc dot gnu dot org
2010-06-07  8:26 ` sfilippone at uniroma2 dot it
2010-06-07  8:27 ` sfilippone at uniroma2 dot it
2010-06-07  9:41 ` burnus at gcc dot gnu dot org
2010-06-08 14:09 ` sfilippone at uniroma2 dot it
2010-06-16 10:32 ` sfilippone at uniroma2 dot it
2010-06-16 10:32 ` sfilippone at uniroma2 dot it
2010-06-21 11:01 ` janus at gcc dot gnu dot org
2010-06-23 12:20 ` sfilippone at uniroma2 dot it
2010-06-25 15:32 ` sfilippone at uniroma2 dot it [this message]
2010-06-25 15:35 ` sfilippone at uniroma2 dot it
2010-07-06 10:14 ` sfilippone at uniroma2 dot it
2010-07-06 10:15 ` sfilippone at uniroma2 dot it
2010-07-07 13:15 ` sfilippone at uniroma2 dot it
2010-07-07 14:25 ` sfilippone at uniroma2 dot it
2010-07-11  9:40 ` janus at gcc dot gnu dot org
2010-07-13  8:54 ` burnus at gcc dot gnu dot org
2010-07-13  9:07 ` sfilippone at uniroma2 dot it
2010-07-13  9:12 ` 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=20100625153154.5649.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).