public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64125] New: Allocation of character strings
@ 2014-11-30 17:50 fmartinez at gmv dot com
  2014-11-30 18:12 ` [Bug fortran/64125] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: fmartinez at gmv dot com @ 2014-11-30 17:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64125

            Bug ID: 64125
           Summary: Allocation of character strings
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fmartinez at gmv dot com

Hi.
The following code inside a module causes the compiler to crash (also in the
latest version of 4.9)

   allocate( character(len=size(right))::left%chars )
 ^
internal compiler error: in gimplify_expr, at gimplify.c:8646
0x572c28 ???
    ../sysdeps/x86_64/elf/start.S:113

Cheers,
Fran


type t_string
  private
  character(len=:), allocatable :: chars
end type t_string



pure subroutine string_assign_from_array( left, right )

! The target string
  type(t_string), intent(out) :: left

! The source string
  character, dimension(:), intent(in) :: right


! Copy memory
  allocate( character(len=size(right)) :: left%chars )
  left%chars = transfer( right, left%chars )

end subroutine string_assign_from_array


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

end of thread, other threads:[~2014-11-30 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-30 17:50 [Bug fortran/64125] New: Allocation of character strings fmartinez at gmv dot com
2014-11-30 18:12 ` [Bug fortran/64125] " dominiq at lps dot ens.fr

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).