public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47348] New: substring with len_trim in array constructor
@ 2011-01-18 18:45 tkoenig at gcc dot gnu.org
  2011-01-18 19:15 ` [Bug fortran/47348] " kargl at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-01-18 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: substring with len_trim in array constructor
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org
            Blocks: 19276


This one is strange; it is with recent trunk.

ig25@linux-fd1f:~/Krempel/Char-4> cat foo.f90
program main
  implicit none
  character(len=3) :: c(3)

  c = 'x'

  print '(3(A,"|"))', (/ (/ trim(c(1)), 'a' /)//'c', 'cd' /)
  print '(3(A,"|"))', (/ (/ c(1)(1:len_trim(c(1))), 'a' /)//'c', 'cd' /)
  print '(3(A,"|"))', (/ (/ c(1)(1:1), 'a' /)//'c', 'cd' /)
end program main
ig25@linux-fd1f:~/Krempel/Char-4> gfortran foo.f90
ig25@linux-fd1f:~/Krempel/Char-4> ./a.out
xc|ac|cd|
x |a |cd|
xc|ac|cd|

The second line should be identical to the first and third one.

Modified from nested_array_constructor_2.f90, BTW.

Goes back at least to 4.4.1, so probably not a regression.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-03-13 17:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 18:45 [Bug fortran/47348] New: substring with len_trim in array constructor tkoenig at gcc dot gnu.org
2011-01-18 19:15 ` [Bug fortran/47348] " kargl at gcc dot gnu.org
2011-01-18 20:43 ` tkoenig at gcc dot gnu.org
2011-01-19 19:45 ` [Bug fortran/47348] wrong string length with " tkoenig at gcc dot gnu.org
2011-01-20  9:19 ` tkoenig at gcc dot gnu.org
2011-01-22 17:48 ` paul.richard.thomas at gmail dot com
2011-02-19 15:11 ` pault at gcc dot gnu.org
2011-02-21 10:38 ` dominiq at lps dot ens.fr
2011-02-21 12:10 ` pault at gcc dot gnu.org
2011-02-21 22:49 ` tkoenig at netcologne dot de
2011-03-13 17:38 ` pault at gcc dot gnu.org
2011-03-13 17:41 ` pault at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).