This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15129] [gfortran] assumed size character arrays passed to subroutines incorrect
- From: "Tobias dot Schlueter at physik dot uni-muenchen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2004 22:38:50 -0000
- Subject: [Bug fortran/15129] [gfortran] assumed size character arrays passed to subroutines incorrect
- References: <20040425142850.15129.bdavis9659@comcast.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de 2004-05-05 22:38 -------
It is interesting to see the tree dump:
[tobi@marktplatz tests]$ cat pr15129.f90.t03.original
MAIN__ ()
{
int1 b[8];
int1 a[10];
_gfortran_copy_string (10, &a, 8, "gfortran");
_gfortran_copy_string (8, &b, 6, "rocks!");
text_io (&a, &b, 10, 8);
text_io ("gfortran ", "rocks !", 9, 7);;
}
text_io (a, b, _a, _b)
{
_gfortran_filename = "pr15129.f90";
_gfortran_ ...
_gfortran_transfer_character ("size=", 5);
{
int4 T.0;
T.0 = _b; // <- HERE IT'S WRONG ...
_gfortran_transfer_integer (&T.0, 4);;
}
_gfortran_transfer_character (a, _b); // ... AND HERE ...
_gfortran_ ...
_gfortran_transfer_character ("size=", 5);
{
int4 T.1;
T.1 = _b; // <- ... AND HERE IT'S RIGHT ...
_gfortran_transfer_integer (&T.1, 4);;
}
_gfortran_transfer_character (b, _b); // <- ... AND HERE AS WELL
_gfortran_st_write_done ();;
In main everything is ok, but in text_io the compiler assumes that both strings
have the same length _b. Maybe it's hardcoded somewhere that the length of an
assumed length string is the last argument passe to the function?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15129