public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/65381] New: ICE during array result, assignment
@ 2015-03-10 17:33 jwmwalrus at gmail dot com
  2015-03-10 17:58 ` [Bug fortran/65381] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jwmwalrus at gmail dot com @ 2015-03-10 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65381
           Summary: ICE during array result, assignment
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwmwalrus at gmail dot com

I get Internal Compiler Error with the following code:

module stringtable_mod

    implicit none
    private
    save

    type, public :: StringList
        character(:), allocatable :: chars
    end type

    type, public :: StringTable
        type(StringList), allocatable :: list(:)
    end type
contains
    pure function fixedStringTable(this) result(fixed)
        class(StringTable), intent(IN) :: this(:)
        character(LEN_MAX(this)) :: fixed(getTableSize(this))
        integer :: i, j, k
        k = 0
        do i = 1, SIZE(this)
            if (.NOT. ALLOCATED(this(i)%list)) cycle

            do j = 1, SIZE(this(i)%list)
                k = k + 1
                fixed(k) = this(i)%list(j)%chars
            enddo
        enddo
    end function

    pure function joinStrings(this) result(joined)
        character(:), allocatable :: joined
        type(StringTable), intent(IN) :: this(:)
        integer :: ln, sz
        character(:), allocatable :: strings(:)
        ln = LEN_MAX(this)
        sz = getTableSize(this)
        allocate (character(ln) :: strings(sz))
        strings(:) = fixedStringTable(this)
        joined=''
    end function

    pure function LEN_MAX(this) result(stringlen)
        integer :: stringlen
        type(StringTable), intent(IN) :: this(:)
        integer :: i, j
        stringlen = 0
    end function

    pure function getTableSize(this) result(sz)
        integer :: sz
        type(StringTable), intent(IN) :: this(:)
        integer :: i
        sz = 0
    end function

end module stringtable_mod



The output is:

$ gfortran-5.0 -c stringtable.f90 
stringtable.f90:38:0:

         strings(:) = fixedStringTable(this)
 ^
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1797
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.



The compiler and system information is:

$ lsb_release -rd && gfortran-5.0 -v
Description:    Debian GNU/Linux 8.0 (jessie)
Release:    8.0
Using built-in specs.
COLLECT_GCC=gfortran-5.0
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 20150225-1'
--with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id
--disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=c++98
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-snap-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-snap-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-snap-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--disable-werror --enable-checking=yes --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.0.0 20150225 (experimental) [trunk revision 220970] (Debian
20150225-1)


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

end of thread, other threads:[~2023-05-28 18:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 17:33 [Bug fortran/65381] New: ICE during array result, assignment jwmwalrus at gmail dot com
2015-03-10 17:58 ` [Bug fortran/65381] " dominiq at lps dot ens.fr
2021-05-14  9:47 ` [Bug fortran/65381] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug fortran/65381] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:31 ` jakub at gcc dot gnu.org
2023-05-28 18:08 ` [Bug fortran/65381] [10/11/12/13/14 " kargl at gcc dot gnu.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).