------- Comment #3 from burnus at gcc dot gnu dot org  2008-01-09 07:39 -------
I don't get an segfault, but:
gamsana1.f90:1550.6:
      SUBROUTINE INVENTNAMES(ROWNAM, COLNAM, RNAMLEN, CNAMLEN, M, N)
     1
Reduced test case:


      PROGRAM GAMSANAL
      IMPLICIT NONE
      INTEGER(4), ALLOCATABLE, DIMENSION(:) :: namI
      CHARACTER,  ALLOCATABLE, DIMENSION(:) :: namC
      INTEGER IODICT, PROWNAM, PCOLNAM, PRNLEN, PCNLEN, M, N
      LOGICAL DICEXIST

      INQUIRE(UNIT=IODICT, EXIST=DICEXIST)
      CALL INVENTNAMES(namC(PROWNAM), M, N)
end

      SUBROUTINE INVENTNAMES(ROWNAM, M, N)
      IMPLICIT NONE
      INTEGER M,N
      CHARACTER ROWNAM(16,M)
      INTEGER RNAMLEN(M)
      END SUBROUTINE

Removing the "N" argument, crashes GCC here; valgrind shows a huge number of
invalid reads, starting with:

==16951== Invalid read of size 1
==16951==    at 0x473909: gfc_undo_symbols (symbol.c:2582)
==16951==    by 0x452454: decode_statement (parse.c:122)
==16951==    by 0x4530C4: next_statement (parse.c:505)
==16951==    by 0x4563B1: gfc_parse_file (parse.c:3317)
==16951==    by 0x47EF04: gfc_be_parse_file (f95-lang.c:260)
==16951==    by 0x6F2314: toplev_main (toplev.c:1042)
==16951==    by 0x52CEB29: (below main) (in /lib64/libc-2.6.1.so)


The reduced program works woth gfortran 4.2, which makes it a regression. (The
full program does not as %VAL is not supported by 4.2.)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org


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

Reply via email to