Hi,
Following invalid code (association stmt sint=>sreal) causes an ICE.
$ cat test.f90
MODULE gswap
TYPE points
REAL :: x, y
END TYPE points
INTERFACE swap
MODULE PROCEDURE sreal, schar, sint => sreal
END INTERFACE swap
CONTAINS
SUBROUTINE sreal(a,b)
real, intent(inout) :: a,b
real :: temp
temp=a
a=b
b=temp
END SUBROUTINE sreal
END MODULE gswap
program test_swap
USE gswap
integer :: i = 2, j=3
call swap(i,j)
end program test_swap
$ gfortran test.f90
In file test.f90:6
MODULE PROCEDURE sreal, schar, sint => sreal
1
Error: Syntax error in MODULE PROCEDURE statement at (1)
test.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.
gdb output
(gdb) r
Program received signal SIGSEGV, Segmentation fault.
0x1001c2d8 in show_locus (offset=0, loc=0x10773018)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/error.c:137
137 error_printf ("In file %s:%d\n", f->filename,
(gdb) bt
#0 0x1001c2d8 in show_locus (offset=0, loc=0x10773018)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/error.c:137
#1 0x1001c4c4 in show_loci (l1=Variable "l1" is not available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/error.c:270
#2 0x22000442 in ?? ()
#3 0x1001b9a4 in error_print (type=0x1054d4b4 "Error:",
format0=0x1054e254 "Procedure '%s' in %s at %L is neither function nor
subroutine", argp=Variable "argp" is not available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/error.c:381
#4 0x1001bd30 in gfc_error (
nocmsgid=0x1054e254 "Procedure '%s' in %s at %L is neither function nor
subroutine") at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/error.c:595
#5 0x1001fd88 in check_interface0 (p=Variable "p" is not available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/interface.c:880
#6 0x10022134 in check_sym_interfaces (sym=0x10772bb8)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/interface.c:960
#7 0x1005ba50 in traverse_ns (st=0x10772b98,
func=0x100220b0 <check_sym_interfaces>)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/symbol.c:2416
#8 0x10021c20 in gfc_check_interfaces (ns=0x107726c0)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/interface.c:1015
#9 0x28000422 in ?? ()
#10 0x10050af4 in gfc_resolve (ns=0x107726c0)
---Type <return> to continue, or q <return> to quit---
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/resolve.c:5436
#11 0x24000482 in ?? ()
#12 0x10046aa4 in gfc_parse_file ()
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/parse.c:2659
#13 0x10066c04 in gfc_be_parse_file (set_yydebug=Variable "set_yydebug" is not
available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/fortran/f95-lang.c:286
#14 0x1034584c in toplev_main (argc=Variable "argc" is not available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/toplev.c:990
#15 0x10093900 in main (argc=Variable "argc" is not available.
)
at /home/gccbuild/gcc_trunk_anonsvn/trunk/gcc/main.c:35
(gdb)
--
Summary: ICE on invalid code
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: regression
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: uttamp at us dot ibm dot com
GCC build triplet: powerpc64-linux
GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252