public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36257]  New: SPREAD gives wrong results with CHARACTER variables
@ 2008-05-17 18:04 fxcoudert at gcc dot gnu dot org
  2008-05-18 10:03 ` [Bug fortran/36257] " pault at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-05-17 18:04 UTC (permalink / raw)
  To: gcc-bugs

This one turned up during my testing of SPREAD on wide character strings, but
it turns out that it already happens on default character variables. It looks
like the front-end doesn't fill the return array descriptor well.

$ cat k2.f90
  implicit none
  character(len=5), dimension(3,3), parameter :: &
    p = reshape(["", "", "", "", "", "", "", "", ""], [3,3])
  character(len=5), dimension(3,3) :: m1

  m1 = p
  if (any (spread (p, 1, 2) /= spread (m1, 1, 2))) call abort

end
$ gfortran k2.f90 && ./a.out 
Fortran runtime error: rank mismatch in spread()

The most amazing is that it's specific to character variables (ie it doesn't
happen with integer, for example).


-- 
           Summary: SPREAD gives wrong results with CHARACTER variables
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

end of thread, other threads:[~2008-05-21 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-17 18:04 [Bug fortran/36257] New: SPREAD gives wrong results with CHARACTER variables fxcoudert at gcc dot gnu dot org
2008-05-18 10:03 ` [Bug fortran/36257] " pault at gcc dot gnu dot org
2008-05-18 10:43 ` [Bug fortran/36257] SPREAD gives wrong results with array CHARACTER parameters tkoenig at gcc dot gnu dot org
2008-05-18 14:56 ` fxcoudert at gcc dot gnu dot org
2008-05-20 13:34 ` fxcoudert at gcc dot gnu dot org
2008-05-21 16:03 ` fxcoudert at gcc dot gnu dot org
2008-05-21 16:13 ` fxcoudert 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).