This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23373] Functions returning pointers with pointer argument
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2005 18:51:43 -0000
- Subject: [Bug fortran/23373] Functions returning pointers with pointer argument
- References: <20050813091629.23373.tkoenig@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tobi at gcc dot gnu dot org 2005-08-13 18:51 -------
Interestingly, for characters we do the correct copying:
schluter@pcl247d:~/src/tests> cat test2.f90
program ac
character*10 a
a = "abc"
a = f(a)
contains
function f(b) result(x)
character*10 b, x
x = "falsch"
b = b//"richtig"
end function
end program
schluter@pcl247d:~/src/tests> ../gcc/build/gcc/f951 test2.f90
-fdump-tree-original -quiet
schluter@pcl247d:~/src/tests> tail -15 test2.f90.t02.original
MAIN__ ()
{
char a[1:10];
static void f (char[1:10] &, int4, char[1:10] &, int4);
_gfortran_copy_string (10, &a, 3, "abc");
{
char str.1[10];
f ((char[1:10] *) &str.1, 10, &a, 10);
_gfortran_copy_string (10, &a, 10, (char[1:10] *) &str.1);
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23373