public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/15809] ICE Using Pointer Functions
Date: Mon, 21 Nov 2005 15:53:00 -0000	[thread overview]
Message-ID: <20051121155328.25781.qmail@sourceware.org> (raw)
In-Reply-To: <bug-15809-7776@http.gcc.gnu.org/bugzilla/>



------- Comment #14 from pault at gcc dot gnu dot org  2005-11-21 15:53 -------
I have become more than a little bit concerned that this PR is a wild goose
chase.

Applying a similar patch to Erik's, I can persuade some bits of code to do
something.  Furthermore, they are even the same things that ifort9.0 does;
right down to segfaulting in the same places... mostly!  However, getting
anything useful out of such subroutines, even with ifort, is defeating me.

>From 12.4.1.1....

"If the dummy argument is a pointer, the actual argument shall be a pointer and
the types, type parameters and ranks shall agree."

Does this not make an automatic, character-length, pointer dummy incorrect
code?

"At the invocation of the procedure, the dummy argument pointer receives the
pointer association status of the actual argument.  If the actual argument is
currently associated, the the dummy argument becomes associated with the same
target... "  

Thus encouraged, I wrote this:

  SUBROUTINE A(p,l)
    CHARACTER(8), DIMENSION(:), pointer :: p
    if (associated (p)) then
      print *, p
    else
      print *, "not associated"
    end if
  END SUBROUTINE A

  character(8), dimension (:), pointer :: ptr
  character(8), dimension (2), target :: tar
  tar = "def"
  ptr => tar
  call a (ptr)
  if (associated (ptr)) print *, "in MAIN, ptr = ", ptr
  end

ifort decides that p is not associated, whilst gfortran finds p to be
associated but fails to recognise that p is a character and produces a "bad
real" message at the print statement.

It seems to me that, in gfortran, the dummy needs to be declared in the
procedure and its data pointer set to that of the actual argument.  Whether an
automatic character length should work or not seems to be moot to me.


-- 


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


  parent reply	other threads:[~2005-11-21 15:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-15809-7776@http.gcc.gnu.org/bugzilla/>
2005-10-23 13:34 ` sven dot buijssen at math dot uni-dortmund dot de
2005-11-21 15:53 ` pault at gcc dot gnu dot org [this message]
2005-11-21 18:06 ` sven dot buijssen at math dot uni-dortmund dot de
2005-11-21 18:08 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2005-11-22 20:16 ` pault at gcc dot gnu dot org
2005-11-23 14:26 ` paul dot richard dot thomas at cea dot fr
2005-11-30 17:26 ` pault at gcc dot gnu dot org
2005-11-30 19:26 ` pault at gcc dot gnu dot org
2005-12-05 11:14 ` jakub at gcc dot gnu dot org
2005-12-07  6:20 ` pault at gcc dot gnu dot org
2005-12-12 20:10 ` pinskia at gcc dot gnu dot org
2004-06-03 20:12 [Bug fortran/15809] New: " giese025 at tc dot umn dot edu
2004-06-03 20:13 ` [Bug fortran/15809] " giese025 at tc dot umn dot edu
2004-06-03 20:21 ` pinskia at gcc dot gnu dot org
2004-07-11 17:10 ` tobi at gcc dot gnu dot org
2004-08-25 22:10 ` tobi at gcc dot gnu dot org
2004-09-22  7:48 ` c dot lemmen at fz-juelich dot de
2004-12-14 17:53 ` pinskia at gcc dot gnu dot org
2005-04-03  2:25 ` szalai at mit dot edu
2005-06-05 22:44 ` pault at gcc dot gnu dot org
2005-08-30 20:44 ` erik dot edelmann at iki dot fi
2005-08-31 19:39 ` tobi at gcc dot gnu dot org
2005-09-02 11:34 ` tobi at gcc dot gnu dot org
2005-09-02 11:58 ` erik dot edelmann at iki dot fi
2005-09-02 15:39 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2005-09-06 21:10 ` erik dot edelmann at iki dot fi
2005-09-08 18:51 ` rsandifo at gcc dot gnu dot org
2005-09-18 19:53 ` tkoenig 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=20051121155328.25781.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).