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/31821] character pointer => target(range) should detect if lengths don't match


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31821

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2010-12-12 14:09:12 UTC ---
The patch in comment#7 causes a regression in

program gfcbug33
  character(12) :: a(2)
  a(1) = "abcdefghijkl"
  a(2) = "mnopqrstuvwx"
  call foo ((a(2:1:-1)(6:)))
contains
  subroutine foo (chr)
    character(7) :: chr(:)
    print *,'X',chr(1),'Y'
    print *,'A',chr(2),'B'
    if (chr(1)//chr(2) .ne. "rstuvwxfghijkl") call abort ()
  end subroutine foo
end program gfcbug33
ig25@linux-fd1f:~/Krempel/Char> gfortran short_1.f90
ig25@linux-fd1f:~/Krempel/Char> ./a.out
 XrstuvwxY
 A%ï2ïfgB
Abgebrochen

which is a shortened version of actual_array_substr_1.f90.

The part of the patch

-         if (substring)
-           primary->ts.u.cl = NULL;
-

opens a can of worms of wrong-code and rejects-valid bugs...


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