This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45170] [F2003] allocatable character lengths
- 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: Fri, 15 Jul 2011 14:04:16 +0000
- Subject: [Bug fortran/45170] [F2003] allocatable character lengths
- Auto-submitted: auto-generated
- References: <bug-45170-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45170
--- Comment #18 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-15 14:02:45 UTC ---
(In reply to comment #16)
> Error: Variable 'length' cannot appear in the expression at (1)
> That comes from the specification expression check.
If one removes the check, it works, i.e. it is just a resolution (resolve.c)
problem and not a code generation one.
(In reply to comment #17)
> subroutine hello (n,string)
> character(:),allocatable,intent(out)::string
> integer,intent(in)::n
> string=helloworld(:n)
That one seems to be a very subtle issue, depending on the modifications (e.g.
allocate(character(len=)) instead of alloc on assignment), one might get the
correct string length - or even the correct string. Looking at the (original)
dump, the string length should be always correct, hence, I think we generate a
slightly wrong tree. The next step would be to look at -fdump-tree-optimized
and then work backwards.