This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/23373] Functions returning pointers with pointer argument


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]