Daily gfortran build downloaded on 22 sep. 2004 for Linux i686 $ gfc --version GNU Fortran 95 (GCC 4.0.0 20040922 (experimental)) Copyright (C) 2003 Free Software Foundation, Inc. $ gfc -c bug.f90 bug.f90: In function 'nullify_pseudo_upf': bug.f90:76: internal compiler error: Segmentation fault $ cat bug.f90 MODULE pseudo_types IMPLICIT NONE INTEGER, PARAMETER :: dbl = selected_real_kind(14,200) SAVE TYPE pseudo_upf CHARACTER(LEN=80):: generated ! CHARACTER(LEN=80):: date_author ! Misc info CHARACTER(LEN=80):: comment ! CHARACTER(LEN=2) :: psd ! Element label CHARACTER(LEN=20) :: typ ! Pseudo type ( NC or US ) LOGICAL :: tvanp ! .true. if Ultrasoft LOGICAL :: nlcc ! Non linear core corrections CHARACTER(LEN=20) :: dft ! Exch-Corr type REAL(dbl) :: zp ! z valence REAL(dbl) :: etotps ! total energy REAL(dbl) :: ecutwfc ! suggested cut-off for wfc REAL(dbl) :: ecutrho ! suggested cut-off for rho LOGICAL :: has_so ! if .true. includes spin-orbit REAL(dbl) :: xmin ! the minimum x of the linear mesh REAL(dbl) :: rmax ! the maximum radius of the mesh REAL(dbl) :: zmesh ! the nuclear charge used for mesh REAL(dbl) :: dx ! the deltax of the linear mesh INTEGER, POINTER :: nn(:) ! nn(nwfc) REAL(dbl), POINTER :: rcut(:) ! cut-off radius(nwfc) REAL(dbl), POINTER :: rcutus(:)! cut-off ultrasoft radius (nwfc) REAL(dbl), POINTER :: epseu(:) ! energy (nwfc) REAL(dbl), POINTER :: jchi(:) ! jchi(nwfc) REAL(dbl), POINTER :: jjj(:) ! jjj(nbeta) INTEGER :: nv ! UPF file version number INTEGER :: lmax ! maximum angular momentum component INTEGER :: mesh ! number of point in the radial mesh INTEGER :: nwfc ! number of wavefunctions INTEGER :: nbeta ! number of projectors CHARACTER(LEN=2), POINTER :: els(:) ! els(nwfc) INTEGER, POINTER :: lchi(:) ! lchi(nwfc) REAL(dbl), POINTER :: oc(:) ! oc(nwfc) REAL(dbl), POINTER :: r(:) ! r(mesh) REAL(dbl), POINTER :: rab(:) ! rab(mesh) REAL(dbl), POINTER :: rho_atc(:) ! rho_atc(mesh) REAL(dbl), POINTER :: vloc(:) ! vloc(mesh) INTEGER, POINTER :: lll(:) ! lll(nbeta) INTEGER, POINTER :: kkbeta(:) ! kkbeta(nbeta) REAL(dbl), POINTER :: beta(:,:) ! beta(mesh,nbeta) INTEGER :: nd REAL(dbl), POINTER :: dion(:,:) ! dion(nbeta,nbeta) INTEGER :: nqf INTEGER :: nqlc REAL(dbl), POINTER :: rinner(:) ! rinner(0:2*lmax) REAL(dbl), POINTER :: qqq(:,:) ! qqq(nbeta,nbeta) REAL(dbl), POINTER :: qfunc(:,:,:) ! qfunc(mesh,nbeta,nbeta) REAL(dbl), POINTER :: qfcoef(:,:,:,:) ! REAL(dbl), POINTER :: chi(:,:) ! chi(mesh,nwfc) REAL(dbl), POINTER :: rho_at(:) ! rho_at(mesh) END TYPE CONTAINS SUBROUTINE nullify_pseudo_upf( upf ) TYPE( pseudo_upf ), INTENT(INOUT) :: upf NULLIFY( upf%els, upf%lchi, upf%jchi, upf%oc ) NULLIFY( upf%r, upf%rab ) NULLIFY( upf%rho_atc, upf%vloc ) NULLIFY( upf%nn, upf%rcut) NULLIFY( upf%rcutus, upf%epseu) NULLIFY( upf%lll, upf%jjj, upf%kkbeta, upf%beta, upf%dion ) NULLIFY( upf%rinner, upf%qqq, upf%qfunc, upf%qfcoef ) NULLIFY( upf%chi ) NULLIFY( upf%rho_at ) RETURN END SUBROUTINE END MODULE pseudo_types
Confirmed. Backtrce: Program received signal SIGSEGV, Segmentation fault. 0x0809bcd3 in gfc_conv_expr_descriptor (se=0xfef53c5c, expr=0x96354e0, ss=0x9639950) at ../../gcc-clean/gcc/fortran/trans-array.c:3566 3566 se->string_length = expr->symtree->n.sym->ts.cl->backend_decl; (gdb) bt #0 0x0809bcd3 in gfc_conv_expr_descriptor (se=0xfef53c5c, expr=0x96354e0, ss=0x9639950) at ../../gcc-clean/gcc/fortran/trans-array.c:3566 #1 0x080a66c3 in gfc_trans_pointer_assignment (expr1=0x96354e0, expr2=0x96356e0) at ../../gcc-clean/gcc/fortran/trans-expr.c:1898 #2 0x080a6849 in gfc_trans_pointer_assign (code=0xfef53c5c) at ../../gcc-clean/gcc/fortran/trans-expr.c:1858 #3 0x08093cba in gfc_trans_code (code=0x9635f20) at ../../gcc-clean/gcc/fortran/trans.c:505 #4 0x080a2550 in gfc_generate_function_code (ns=0x9634ea8) at ../../gcc-clean/gcc/fortran/trans-decl.c:2217 #5 0x08093f92 in gfc_generate_module_code (ns=0x9632550) at ../../gcc-clean/gcc/fortran/trans.c:708 #6 0x08079a50 in gfc_parse_file () at ../../gcc-clean/gcc/fortran/parse.c:2618 #7 0x08090735 in gfc_be_parse_file (set_yydebug=0) at ../../gcc-clean/gcc/fortran/f95-lang.c:265 #8 0x083ba13d in toplev_main (argc=0, argv=0xfef53ed4) at ../../gcc-clean/gcc/toplev.c:991 #9 0x00125ad4 in __libc_start_main () from /lib/tls/libc.so.6 #10 0x0804ab01 in _start () (gdb) This looks like another bug. Will look it up in a minute.
Couldn't find it. Maybe it's a new one after all.
Couldn't find it. Maybe it's a new one after all. Confirmed for real, this time.
Created attachment 7216 [details] First attempt at fixing this PR This is a patch which fixes the bug, but I haven't yet run the testsuite, and I didn't look it through for stupid bugs. YMMV ChangeLog: 2004-09-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/17612 * trans-expr.c (gfc_get_expr_strlen): New function. * trans.h (gfc_get_expr_strlen): Add prototype. * trans-array.c (gfc_conv_expr_descriptor): Use gfc_get_expr_strlen to determine string length.
OK, I just looked at my testsuite run, and pr15324 is already broken again with my patch. I'll look into this in more detail tomorrow.
Created attachment 7217 [details] Updated patch which fixes the bug Updated patch which passes the testsuite. I still need to isolate a small testcase before submitting it for review.
Patch submitted for review: http://gcc.gnu.org/ml/fortran/2004-09/msg00252.html
*** Bug 15494 has been marked as a duplicate of this bug. ***
Fixed.