This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16939] Pointers not passed as subroutine arguments
- 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: 9 May 2005 13:40:36 -0000
- Subject: [Bug fortran/16939] Pointers not passed as subroutine arguments
- References: <20040809142725.16939.paulthomas2@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tobi at gcc dot gnu dot org 2005-05-09 13:40 -------
What is wrong is this from the .t02.original dump:
create (temp_ptr, _temp_ptr)
{
char[1:15] * new_item;
{
void * * ptr.0;
ptr.0 = (void * *) &new_item;
_gfortran_allocate (ptr.0, 15, 0);
}
_gfortran_copy_string (15, new_item, 14, " A NEW STRING ");
temp_ptr = (char[1:15] * &) new_item;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_gfortran_filename = "pr16939.f90";
_gfortran_line = 19;
_gfortran_ioparm.unit = 6;
_gfortran_ioparm.list_format = 1;
_gfortran_st_write ();
_gfortran_transfer_character (temp_ptr, 15);
_gfortran_st_write_done ();
goto __return_create;
__return_create:;
}
The underlined line should be
temp_ptr = new_item
unless I misread something. temp_ptr should point to the same character string
new_item points to. The underlined statement makes it point to new_item instead.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16939