[Bug fortran/58471] New: ICE on invalid with missing type constructor and -Wall
abensonca at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Sep 18 23:01:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58471
Bug ID: 58471
Summary: ICE on invalid with missing type constructor and -Wall
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: abensonca at gmail dot com
The following causes an ICE with gfortran 4.9.0 (r202667) when compiled with
-Wall:
module cf
type :: cfmde
end type cfmde
interface cfmde
module procedure mdedc
end interface cfmde
contains
subroutine cfi()
implicit none
type(cfmde), pointer :: cfd
cfd=cfmde()
return
end subroutine cfi
end module cf
$ gfortran -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-trunk/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/opt/gcc-trunk
--enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 4.9.0 20130917 (experimental) (GCC)
$ gfortran -c bug1.F90 -o bug1.o -Wall
bug1.F90:5.22:
module procedure mdedc
1
Error: Procedure 'mdedc' in generic interface 'cfmde' at (1) is neither
function nor subroutine
f951: internal compiler error: Segmentation fault
0x99112f crash_signal
../../gcc-trunk/gcc/toplev.c:335
0x582892 gfc_expr_attr(gfc_expr*)
../../gcc-trunk/gcc/fortran/primary.c:2259
0x53a40c gfc_check_assign(gfc_expr*, gfc_expr*, int)
../../gcc-trunk/gcc/fortran/expr.c:3160
0x58f872 resolve_ordinary_assign
../../gcc-trunk/gcc/fortran/resolve.c:9200
0x58f872 resolve_code
../../gcc-trunk/gcc/fortran/resolve.c:9810
0x591b0e resolve_codes
../../gcc-trunk/gcc/fortran/resolve.c:14507
0x591a17 resolve_codes
../../gcc-trunk/gcc/fortran/resolve.c:14493
0x591bf2 gfc_resolve
../../gcc-trunk/gcc/fortran/resolve.c:14535
0x57efdf gfc_parse_file()
../../gcc-trunk/gcc/fortran/parse.c:4645
0x5baab5 gfc_be_parse_file
../../gcc-trunk/gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
without -Wall the correct error message is generated:
$ gfortran -c bug1.F90 -o bug1.o
bug1.F90:5.22:
module procedure mdedc
1
Error: Procedure 'mdedc' in generic interface 'cfmde' at (1) is neither
function nor subroutine
bug1.F90:11.8:
cfd=cfmde()
1
Error: Can't convert REAL(4) to TYPE(cfmde) at (1)
Adding a suitable "mdedc" procedure results in successful compilation.
More information about the Gcc-bugs
mailing list