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/54070] Wrong code with allocatable deferred-length (array) function results


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


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