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/16939] Pointers not passed as subroutine arguments


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


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