This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17192] Functions returning character pointer via argument are broken
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2005 08:10:56 -0000
- Subject: [Bug fortran/17192] Functions returning character pointer via argument are broken
- References: <20040825220057.17192.tobi@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-05-11 08:10 -------
It does still compile, but does still not return the right answer. The problem
disappears if "integer" is used instead of "character*5". The tree dump
(obtained with -fdump-tree-original) is:
s (__result, .__result, e, d, _e, _d)
{
_gfortran_copy_string (5, e, 5, d);
__result = (char[1:5] * &) &c;
MAIN__ ()
{
char c[1:5];
char[1:5] * p;
static void s (char[1:5] * &, int4, char[1:5] &, char[1:5] &, int4, int4);
_gfortran_copy_string (5, &c, 5, "Hallo");
p = (char[1:5] *) &c;
{
char str.0[5];
s ((char[1:5] *) &str.0, 5, &c, p, 5, 5);
_gfortran_copy_string (5, &c, 5, (char[1:5] *) &str.0);
}
/* ...snip... call output routines */
}
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|ice-on-valid-code |
Last reconfirmed|2004-11-11 05:20:44 |2005-05-11 08:10:52
date| |
Summary|Functions returning pointer |Functions returning
|via argument are broken |character pointer via
| |argument are broken
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17192