public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "eedelman at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/25806] problems with functions returning array pointers?
Date: Sat, 04 Feb 2006 20:52:00 -0000	[thread overview]
Message-ID: <20060204205233.14383.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25806-11807@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from eedelman at gcc dot gnu dot org  2006-02-04 20:52 -------
Created an attachment (id=10777)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10777&action=view)
Patch to fix the bug.

We also get into trouble if we try to pass the result of a pointer-to-array
returning funtion as an argument to another procedure (e.g.

   call a_suborutine (x(5))

)

The problem, both for this case and

   print *, x(5)

is that we try to free the temporary used to hold the result. This we mustn't
do, since the temporary will be just a shallow copy of the resulting array.

The attached patch fixes these problems, but is not yet well tested. 


-- 


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


  parent reply	other threads:[~2006-02-04 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-16 10:35 [Bug fortran/25806] New: " jpr at csc dot fi
2006-01-16 16:30 ` [Bug fortran/25806] " pinskia at gcc dot gnu dot org
2006-01-16 16:54 ` rguenth at gcc dot gnu dot org
2006-02-04 17:11 ` eedelman at gcc dot gnu dot org
2006-02-04 20:52 ` eedelman at gcc dot gnu dot org [this message]
2006-02-06 21:51 ` eedelman at gcc dot gnu dot org
2006-02-12 17:34 ` eedelman at gcc dot gnu dot org
2006-02-14 17:34 ` eedelman at gcc dot gnu dot org
2006-02-14 20:31 ` eedelman 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=20060204205233.14383.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).