------- Comment #6 from dfranke at gcc dot gnu dot org 2010-05-07 22:09 ------- Not related to ISO-C.
Reduced test case: MODULE f03_test INTERFACE INTEGER FUNCTION build(lib, np) END FUNCTION END INTERFACE PROCEDURE(build), POINTER :: pbuild CONTAINS XXXX ! simply generate any error END MODULE f03_test end dan...@silence:~/pr$ valgrind /home/daniel/i686-pc-linux-gnu/gcc/libexec/gcc/i686-pc-linux-gnu/4.6.0/f951 pr40994.f90 ==20641== Memcheck, a memory error detector ==20641== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==20641== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==20641== Command: /home/daniel/i686-pc-linux-gnu/gcc/libexec/gcc/i686-pc-linux-gnu/4.6.0/f951 pr40994.f90 ==20641== pr40994.f90:10.50: SUBROUTINE test_bind_c BIND(C,name="test_bind_c") 1 Error: Missing required parentheses before BIND(C) at (1) pr40994.f90:11.4: END SUBROUTINE test_bind_c 1 Error: Expecting END MODULE statement at (1) pr40994.f90:4.30-26: INTEGER FUNCTION build(lib, np) BIND(C) 2 1 Warning: Implicitly declared variable 'lib' at (1) may not be C interoperable but it is a dummy argument to the BIND(C) procedure 'build' at (2) pr40994.f90:4.34-26: INTEGER FUNCTION build(lib, np) BIND(C) 2 1 Warning: Implicitly declared variable 'np' at (1) may not be C interoperable but it is a dummy argument to the BIND(C) procedure 'build' at (2) pr40994.f90:4.26: INTEGER FUNCTION build(lib, np) BIND(C) 1 Warning: Variable 'build' at (1) may not be a C interoperable kind but it is bind(c) ==20641== Invalid read of size 4 ==20641== at 0x81578A2: gfc_undo_symbols (symbol.c:2813) ==20641== by 0x8125CE6: decode_statement (parse.c:271) ==20641== by 0x81277D0: next_free (parse.c:722) ==20641== by 0x8127BB9: next_statement (parse.c:907) ==20641== by 0x812BD8D: gfc_parse_file (parse.c:4220) ==20641== by 0x8167059: gfc_be_parse_file (f95-lang.c:239) ==20641== by 0x8481F2A: compile_file (toplev.c:1053) ==20641== by 0x4131BD5: (below main) (libc-start.c:226) ==20641== Address 0x430a910 is 136 bytes inside a block of size 296 free'd ==20641== at 0x4024B3A: free (vg_replace_malloc.c:366) ==20641== by 0x815710F: gfc_free_symbol (symbol.c:2485) ==20641== by 0x8157FEF: free_sym_tree (symbol.c:3087) ==20641== by 0x81582AD: gfc_free_namespace (symbol.c:3231) ==20641== by 0x81570C7: gfc_free_symbol (symbol.c:2476) ==20641== by 0x8157FEF: free_sym_tree (symbol.c:3087) ==20641== by 0x8157F5B: free_sym_tree (symbol.c:3068) ==20641== by 0x8157F5B: free_sym_tree (symbol.c:3068) ==20641== by 0x8157F5B: free_sym_tree (symbol.c:3068) ==20641== by 0x8157F5B: free_sym_tree (symbol.c:3068) ==20641== by 0x8157F5B: free_sym_tree (symbol.c:3068) ==20641== by 0x81582AD: gfc_free_namespace (symbol.c:3231) [...] -- dfranke at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dfranke at gcc dot gnu dot | |org OtherBugsDependingO|32630 | nThis| | Keywords| |error-recovery, ice-on- | |invalid-code Known to fail|4.4.1 4.5.0 |4.4.1 4.5.0 4.6.0 Summary|ICE with BIND(C) |ICE in gfc_undo_symbols http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40994