This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31258] segfault with transpose(reshape(char))
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2007 00:01:01 -0000
- Subject: [Bug fortran/31258] segfault with transpose(reshape(char))
- References: <bug-31258-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-03-21 00:01 -------
(In reply to comment #0)
> CHARACTER(LEN=3), DIMENSION(10) :: Z
> CHARACTER(LEN=10) :: res
> Z(:)="123"
> write(*,'(10A1)') TRANSPOSE(RESHAPE(Z(:)(2:2),(/5,2/)))
> END
Same thing happens with
write(*,'(10A1)') RESHAPE(Z(:)(2:2),(/5,2/))
The segfault is due to the reshape symbol not having a charlen, and this is in
turn due to the source argument of RESHAPE (that is Z(:)(2:)) not having a
charlen itself: gfc_resolve_reshape simply copies the typespec of the source
arg into the result.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-03-21 00:01:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31258