public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/61615] Failure to resolve correct generic with TYPE(C_PTR) arguments
Date: Sat, 12 Jul 2014 22:19:00 -0000	[thread overview]
Message-ID: <bug-61615-4-Xoj39pSqAf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61615-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61615

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-07-12
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
If I use Fortran pointers as below, I get the "expected" output

MODULE foo
  USE iso_c_binding
  IMPLICIT NONE
  INTERFACE bar
    MODULE PROCEDURE bar_s
    MODULE PROCEDURE bar_a1d
  END INTERFACE bar
CONTAINS
  SUBROUTINE bar_s(a, b)
    real, pointer :: a, b
    WRITE (0, *) 'in bar_s'
  END SUBROUTINE bar_s

  SUBROUTINE bar_a1d(a, b)
    real, pointer :: a(:), b(:)
    WRITE (0, *) 'in bar_a1d'
  END SUBROUTINE bar_a1d
END MODULE foo

PROGRAM cptr_array_vs_scalar_arg
  USE foo
  USE iso_c_binding
  IMPLICIT NONE
  INTEGER, TARGET :: i
  real, pointer :: a, b
  real, pointer :: c(:), d(:)
  CALL bar(a, b)
  CALL bar(c, d)
END PROGRAM cptr_array_vs_scalar_arg

I don't understand how the code in comment 0 can distinguish bar_s from bar_a1d
based on the variable locations in memory, nor why it chooses bar_a1d.


  parent reply	other threads:[~2014-07-12 22:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 22:48 [Bug fortran/61615] New: " thatcadguy at gmail dot com
2014-06-27 14:47 ` [Bug fortran/61615] " thatcadguy at gmail dot com
2014-07-12 22:19 ` dominiq at lps dot ens.fr [this message]
2014-07-13 15:09 ` dominiq at lps dot ens.fr
2014-07-13 15:39 ` anlauf at gmx dot de
2014-07-13 16:08 ` dominiq at lps dot ens.fr
2015-10-09  8:58 ` dominiq at lps dot ens.fr
2023-04-11 14:56 ` anlauf at gcc dot gnu.org
2023-04-12  9:14 ` cvs-commit at gcc dot gnu.org
2023-04-12  9:21 ` anlauf at gcc dot gnu.org
2023-04-23 18:53 ` cvs-commit at gcc dot gnu.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=bug-61615-4-Xoj39pSqAf@http.gcc.gnu.org/bugzilla/ \
    --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).