public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/15494] New: [gfortran] ICE on valid code, array of strings
@ 2004-05-17 22:38 martin at mpa-garching dot mpg dot de
  2004-05-17 22:48 ` [Bug fortran/15494] " martin at mpa-garching dot mpg dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-05-17 22:38 UTC (permalink / raw)
  To: gcc-bugs

The following code causes current gfortran to crash with an ICE:

module linebufmod
implicit none
private

public linebuf, linebuf_add

type linebuf
  character(len=80), dimension(:), pointer :: data=>NULL()
  integer :: size=0
end type linebuf

contains

subroutine linebuf_add (buf, line)
  type(linebuf), intent(inout) :: buf
  character(len=*), intent(in) :: line

  character(len=80), dimension(:), pointer :: data2

data2=>NULL()

  if (.not. associated(buf%data)) allocate(buf%data(10))

  if (size(buf%data)==buf%size) then
    allocate (data2(2*size(buf%data)))
    data2(1:size(buf%data)) = buf%data
    deallocate (buf%data)
    buf%data => data2
  endif

  buf%size=buf%size+1
  buf%data(buf%size) = trim (line)
end subroutine linebuf_add

end module linebufmod


~/tmp>gfortran -v -c bug.f90
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--with-gmp=/afs/mpa/data/martin/mygmp --disable-checking
Thread model: posix
gcc version 3.5.0 20040517 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/3.5.0/f951 bug.f90
-quiet -dumpbase bug.f90 -mtune=pentiumpro -auxbase bug -version -o /tmp/cceuAkva.s
GNU F95 version 3.5.0 20040517 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.5.0 20040517 (experimental).
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63317
f951: /scratch/gcc/gcc/fortran/trans-expr.c:1590: gfc_trans_scalar_assign:
Assertion `lse->string_length != (tree) ((void *)0) && rse->string_length !=
(tree) ((void *)0)' failed.
bug.f90: In function `linebuf_add':
bug.f90:26: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: [gfortran] ICE on valid code, array of strings
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org,martin at mpa-garching
                    dot mpg dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2004-09-27 14:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-17 22:38 [Bug fortran/15494] New: [gfortran] ICE on valid code, array of strings martin at mpa-garching dot mpg dot de
2004-05-17 22:48 ` [Bug fortran/15494] " martin at mpa-garching dot mpg dot de
2004-05-17 23:07 ` pinskia at gcc dot gnu dot org
2004-08-26  9:09 ` [Bug fortran/15494] " reichelt at gcc dot gnu dot org
2004-08-26  9:12 ` reichelt at gcc dot gnu dot org
2004-08-26  9:25 ` reichelt at gcc dot gnu dot org
2004-09-27 14:40 ` tobi 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).