This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25806] problems with functions returning array pointers?
- From: "eedelman at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Feb 2006 20:52:33 -0000
- Subject: [Bug fortran/25806] problems with functions returning array pointers?
- References: <bug-25806-11807@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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