public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34306]  New: misprinting of derived types
@ 2007-11-30 23:40 dominiq at lps dot ens dot fr
  2007-11-30 23:59 ` [Bug fortran/34306] " dominiq at lps dot ens dot fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-11-30 23:40 UTC (permalink / raw)
  To: gcc-bugs

While looking at PR18022, I stumbled over the following problem illustrated by
the reduced code from the original one:

program test_bug

  implicit none

  character(len=2), dimension(4,2) :: tab_c
  character(len=30) :: buf1, buf2

  type :: point
     character(len=2) :: x,y
  end type point
  type(point), dimension(4) :: pts

  tab_c(:,1)(:) = (/'1','2','3','4'/)
  tab_c(:,2)(:) = (/'2','3','4','5'/)

  pts%x =  tab_c(:,1)
  pts%y =  tab_c(:,2)

  if (any(pts%x /= tab_c(:,1)) .or. any(pts%y /= tab_c(:,2))) call abort()

  write (buf1, *) pts
  write (buf2, *) tab_c

  print *, buf1
  print *, buf2

  if (buf1 /= buf2) call abort()

end program test_bug

which gives

  1 2 2 3 3 4 4 5              
  1 2 3 4 2 3 4 5              
Abort


-- 
           Summary: misprinting of derived types
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr
 GCC build triplet: i686-apple-darwin9
  GCC host triplet: i686-apple-darwin9
GCC target triplet: i686-apple-darwin9


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


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

end of thread, other threads:[~2007-12-02 20:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-30 23:40 [Bug fortran/34306] New: misprinting of derived types dominiq at lps dot ens dot fr
2007-11-30 23:59 ` [Bug fortran/34306] " dominiq at lps dot ens dot fr
2007-12-01 20:43 ` jvdelisle at gcc dot gnu dot org
2007-12-01 21:22 ` dominiq at lps dot ens dot fr
2007-12-02 20:20 ` terry at chem dot gu dot se
2007-12-02 20:59 ` jvdelisle at gcc dot gnu dot 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).