------- Comment #6 from burnus at gcc dot gnu dot org  2009-04-23 13:57 -------
Shorter, but gives not an error message but simply segfaults. (By the way, for
all tests I tried, gfortran 4.1 to 4.4 crashes, i.e. it is no regression.)

Seemingly, no one had tried before to pass an array to the FMT= argument of a
data transfer statement.

F2003 has: "9.5.1.1 FMT= specifier in a data transfer statement" [...] "If
default-char-expr is an array, it is treated as if all of the elements of the
array were specified in array element order and were concatenated."

subroutine test (v2)
  character(len=8) :: v2(:)
  write (*,v2(1:1)) 1
end subroutine test

==21619== Invalid read of size 4
==21619==    at 0x5317FF: gfc_conv_scalarized_array_ref (trans-array.c:2411)
==21619==    by 0x5322F4: gfc_conv_array_ref (trans-array.c:2460)
==21619==    by 0x54C971: gfc_conv_variable (trans-expr.c:679)
==21619==    by 0x559C4C: set_string (trans-io.c:595)
==21619==    by 0x55B8C5: build_dt (trans-io.c:1746)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2009-04-23 13:57:12
               date|                            |


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

Reply via email to