public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/34306]  New: misprinting of derived types
Date: Fri, 30 Nov 2007 23:40:00 -0000	[thread overview]
Message-ID: <bug-34306-12313@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2007-11-30 23:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 23:40 dominiq at lps dot ens dot fr [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-34306-12313@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).