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/47519] Deferred-length string wrong results with character intrinsic functions


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)


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