[EMAIL PROTECTED]:~/src/work/bug> cat t.f90
module const
! Kind parameters
integer, parameter :: dp = kind(1d0)
double precision reimMUE(2), reMUE, imMUE
equivalence (MUE, reimMUE)
equivalence (reimMUE(1), reMUE), (reimMUE(2), imMUE)
end module const
module cross_section
use const, only: dp
end module cross_section
use const
use cross_section
implicit none
end program
[EMAIL PROTECTED]:~/src/work/bug> ~/src/gcc/build/gcc/f951 t.f90
t.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[EMAIL PROTECTED]:~/src/work/bug> ~/src/gcc/build/gcc/f951 --version
GNU F95 version 4.2.0 20060421 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 4.2.0 20060421 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
[EMAIL PROTECTED]:~/src/work/bug> gdb ~/src/gcc/build/gcc/f951
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".
(gdb) run t.f90
Starting program: /home/pcl331/schluter/src/gcc/build/gcc/f951 t.f90
Program received signal SIGSEGV, Segmentation fault.
0x0808dc3d in resolve_types (ns=0x870d288) at ../../gcc/fortran/resolve.c:5829
5829 last_ts = &eq->expr->symtree->n.sym->ts;
(gdb) bt
#0 0x0808dc3d in resolve_types (ns=0x870d288)
at ../../gcc/fortran/resolve.c:5829
#1 0x080902bc in gfc_resolve (ns=0x870d288)
at ../../gcc/fortran/resolve.c:6252
#2 0x08086059 in gfc_parse_file () at ../../gcc/fortran/parse.c:3179
#3 0x080a64dd in gfc_be_parse_file (set_yydebug=0)
at ../../gcc/fortran/f95-lang.c:301
#4 0x08391fea in toplev_main (argc=2, argv=0xbffff984)
at ../../gcc/toplev.c:999
#5 0x080d867f in main (argc=Cannot access memory at address 0x1
) at ../../gcc/main.c:35
(gdb) p eq->expr->symtree
$2 = (gfc_symtree *) 0x0
(gdb)
For the bug to trigger both the direct and the indirect use as well as the ONLY
clause are necessary. Note that the actual code location is in
resolve_equivalence, so the bug is probably due to gfortran trying to
understand an equivalence whose member variables have not been loaded, due to
the ONLY clause.
--
Summary: Segfault with EQUIVALENCEs in modules together with ONLY
clauses
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tobi at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27269