This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37744] New: ICE-on-invalid with ISO_C_BINDING and TYPEs
- From: "dennis dot wassel at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2008 09:31:25 -0000
- Subject: [Bug fortran/37744] New: ICE-on-invalid with ISO_C_BINDING and TYPEs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
f951 hangs or segfaults on this invalid piece of code, after printing the
correct diagnostic message.
The example is very sensitive to changes (even comments or whitespace), causing
f951 to either hang, segfault or abort gracefully; this version provokes a
segfault. The compiler can be provoked to hang by
a) invoking gfortran -march=i686 -mtune=generic pr.F90
b) removing the _C_BOOL modifier from .FALSE.
Output is
$ gfortran -v pr.F90
Driving: gfortran -v pr.F90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.3.2/configure --enable-version-specific-runtime-libs
-enable-languages=c,c++,fortran --program-suffix=-4.3.2 --with-arch=core2
--with-tune=core2
Thread model: posix
gcc version 4.3.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=core2' '-march=core2'
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.3.2/cc1 -E -lang-fortran
-traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v pr.F90 -mtune=core2 -march=core2
-o /tmp/ccY5rhzV.f95
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.2/include
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=core2' '-march=core2'
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.3.2/f951 /tmp/ccY5rhzV.f95
-ffree-form -quiet -dumpbase pr.F90 -mtune=core2 -march=core2 -auxbase pr
-version -fpreprocessed -fintrinsic-modules-path
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.2/finclude -o /tmp/ccWmyykH.s
GNU F95 (GCC) version 4.3.2 (i686-pc-linux-gnu)
compiled by GNU C version 4.3.2, GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64448
pr.F90:22.19:
foo%flags(trouble) = .FALSE._C_BOOL
1
Error: Symbol 'trouble' at (1) has no IMPLICIT type
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
I plugged f951 into the debugger and it said the culprit is here:
gfc_undo_symbols () at gcc/fortran/symbol.c:2180
I cannot follow this any further myself right now.
Good hunting!
--
Summary: ICE-on-invalid with ISO_C_BINDING and TYPEs
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dennis dot wassel at googlemail dot com
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37744