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: Sun, 13 Jul 2014 16:08:00 -0000	[thread overview]
Message-ID: <bug-61615-4-saZoeLJgiI@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

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Well, my understanding is that
>
>     TYPE(c_ptr) :: a, b
>
> are pointers (void*) and
>
>     TYPE(c_ptr) :: a(:), b(:)
>
> are arrays of pointers (void**).

The result of -fdump-tree-original of

PROGRAM cptr_array_vs_scalar_arg
  USE iso_c_binding
  IMPLICIT NONE
  INTEGER, TARGET :: i, j(5)
  TYPE(c_ptr) :: a, b
  a = C_LOC(i)
  b = C_LOC(j)
END PROGRAM cptr_array_vs_scalar_arg

is

cptr_array_vs_scalar_arg ()
{
  void * a;
  void * b;
  integer(kind=4) i;
  integer(kind=4) j[5];

  {
    void * D.2336;

    D.2336 = (void *) &i;
    a = D.2336;
  }
  {
    void * D.2337;

    D.2337 = (void *) &j;
    b = D.2337;
  }
}


main (integer(kind=4) argc, character(kind=1) * * argv)
{
  static integer(kind=4) options.0[9] = {68, 1023, 0, 0, 1, 1, 0, 0, 31};

  _gfortran_set_args (argc, argv);
  _gfortran_set_options (9, &options.0[0]);
  cptr_array_vs_scalar_arg ();
  return 0;
}


  parent reply	other threads:[~2014-07-13 16:08 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
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 [this message]
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-saZoeLJgiI@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).