This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54070] Wrong code with allocatable deferred-length (array) function results
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jul 2012 10:23:15 +0000
- Subject: [Bug fortran/54070] Wrong code with allocatable deferred-length (array) function results
- Auto-submitted: auto-generated
- References: <bug-54070-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54070
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-07-23 10:23:15 UTC ---
(In reply to comment #0)
> function f()
> character(len=:),allocatable :: f
> f ="ABC"
> end function
Here, one has for the internal length assignment:
.__result = 3
The RHS is a simple "3", but the LHS is a pointer to an integer ...
* * *
(In reply to comment #0)
> One gets the same ICE for the original example. Looking at the dump, there is
> no (re)allocation - but there should be one!
Pilot error of mine: As that code also lacks an ALLOCATE, it is also invalid
without an explicit ALLOCATE statement.
(The real-world program uses an array on the RHS. When the result_string has no
"dimension(:)", it compiled. For both, cf. email.)