This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47519] Deferred-length string wrong results with character intrinsic functions
- 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, 28 Jan 2011 18:29:10 +0000
- Subject: [Bug fortran/47519] Deferred-length string wrong results with character intrinsic functions
- Auto-submitted: auto-generated
- References: <bug-47519-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47519
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Summary|ICE on allocation of with |Deferred-length string
|deferred-length string |wrong results with
| |character intrinsic
| |functions
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-28 18:28:52 UTC ---
The problem is the line:
allocate(name, SOURCE=repeat('x',n))
A simplified (and not ICEing) version is:
n = 10
name = repeat('x',n)
name = repeat('x',4)
name = repeat('x',n)//"123"
For the first "repeat" len(name) is 0, for the second "repear' one gets the
expected "xxxx". The third one gives "xxx".
In case of the allocate, the problem is that both
code->expr3->ts.u.cl->backend_decl
and
code->expr3->ts.u.cl->length
are NULL pointers. (code->expr3->expr_type is EXPR_FUNCTION)