[Bug fortran/25252] ICE on invalid code
--- Comment #20 from patchapp at dberlin dot org 2007-11-20 05:03 --- Subject: Bug number PR 25252 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00949.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #17 from fxcoudert at gcc dot gnu dot org 2007-11-17 16:55 --- Mine, I have posted a patch. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org URL||http://gcc.gnu.org/ml/gcc- ||patches/2007- ||11/msg00949.html Status|NEW |ASSIGNED Keywords||patch Last reconfirmed|2007-11-10 00:53:08 |2007-11-17 16:55:21 date|| Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #18 from fxcoudert at gcc dot gnu dot org 2007-11-17 17:49 --- Subject: Bug 25252 Author: fxcoudert Date: Sat Nov 17 17:49:45 2007 New Revision: 130259 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=130259 Log: PR fortran/25252 * interface.c (gfc_current_interface_head, gfc_set_current_interface_head): New functions. * decl.c (gfc_match_modproc): Move check for syntax error earlier. On syntax error, restore previous state of the interface. * gfortran.h (gfc_current_interface_head, gfc_set_current_interface_head): New prototypes. * gfortran.dg/interface_22.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/interface_22.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/interface.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #19 from fxcoudert at gcc dot gnu dot org 2007-11-17 17:54 --- Fixed. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #16 from fxcoudert at gcc dot gnu dot org 2007-11-10 00:53 --- The following patch clears part of the problem, for example the following testcase: module g interface i module procedure sint = sreal end interface i end module g More is needed, but I'm stuck. I've used valgrind, and I think we don't recover well after gfc_match_modproc() exiting with MATCH_ERROR. Index: decl.c === --- decl.c (revision 129869) +++ decl.c (working copy) @@ -5862,12 +5862,23 @@ gfc_match_modproc (void) for (;;) { + bool last = false; + m = gfc_match_name (name); if (m == MATCH_NO) goto syntax; if (m != MATCH_YES) return MATCH_ERROR; + /* Check for syntax error before starting to add symbols to the +current namespace. */ + if (gfc_match_eos () == MATCH_YES) + last = true; + if (!last gfc_match_char (',') != MATCH_YES) + goto syntax; + + /* Now we're sure the syntax is valid, we process this item +further. */ if (gfc_get_symbol (name, module_ns, sym)) return MATCH_ERROR; @@ -5881,10 +5892,8 @@ gfc_match_modproc (void) sym-attr.mod_proc = 1; - if (gfc_match_eos () == MATCH_YES) + if (last) break; - if (gfc_match_char (',') != MATCH_YES) - goto syntax; } return MATCH_YES; -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added CC||fxcoudert at gcc dot gnu dot ||org Last reconfirmed|2007-11-02 13:18:42 |2007-11-10 00:53:08 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #15 from jvdelisle at gcc dot gnu dot org 2007-11-02 13:18 --- I still get segfault with the original case and garbled text on the case in comment #7 -- jvdelisle at gcc dot gnu dot org changed: What|Removed |Added Last reconfirmed|2006-01-27 20:44:57 |2007-11-02 13:18:42 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #14 from reichelt at gcc dot gnu dot org 2007-11-02 09:55 --- The ICE disappeared on i686-pc-linux-gnu between 2007-08-15 and 2007-09-14. Can anybody else reproduce the problem or can we close the PR? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #12 from reichelt at gcc dot gnu dot org 2007-06-07 22:56 --- Although PR18923 is fixed now, this testcase (from comment#7) is still crashing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #13 from jvdelisle at gcc dot gnu dot org 2007-06-08 00:46 --- Yes, it turns out not to be a complete duplicate. I am still working on this one. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #11 from jvdelisle at gcc dot gnu dot org 2007-06-02 08:30 --- I have a patch for PR18923 that also appears to fix this. Testing now. I think this is a duplicate. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #10 from dfranke at gcc dot gnu dot org 2007-05-21 20:16 --- The testcase of comment #7 seen through valgrind: pr25252.f90:3.26: module procedure X, Y, 1 Error: Syntax error in MODULE PROCEDURE statement at (1) ==12169== Invalid read of size 2 ==12169==at 0x80660ED: check_interface0 (interface.c:945) ==12169== Address 0x42121AA is 34 bytes inside a block of size 128 free'd ==12169==at 0x402119F: free (vg_replace_malloc.c:233) ==12169==by 0x80A4D9A: gfc_undo_symbols (symbol.c:2359) [more to follow] This is indeed similar to PR18923, as pointed out in comment #9. -- dfranke at gcc dot gnu dot org changed: What|Removed |Added CC||dfranke at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #9 from reichelt at gcc dot gnu dot org 2007-05-18 21:27 --- Still crashes for me on mainline and 4.1 and 4.2 branch (i686-pc-linux-gnu). Looks like there are some invalid pointers. Whether the program crashes or not depends on the garbage they are pointing to. This looks actually similar to PR 18923 where we also get crashes or garbled names in error messages. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #8 from jvdelisle at gcc dot gnu dot org 2007-05-13 23:36 --- I get no ice or segfault on the original test case nor the one in Comment #7. I do get what looks like some garbled text on the second test case: Error: Procedure '#65533;,#65533;' in generic interface 'bar' at (1) is neither function nor subroutine -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #7 from reichelt at gcc dot gnu dot org 2007-03-10 22:15 --- Here's a shorter testcase, that crashes since GCC 4.0.0 on i686-pc-linux-gnu: = module FOO interface BAR module procedure X, Y, end interface BAR end module = -- reichelt at gcc dot gnu dot org changed: What|Removed |Added CC||reichelt at gcc dot gnu dot ||org Keywords||monitored http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #5 from kargl at gcc dot gnu dot org 2007-02-15 20:50 --- Does this still fail for others? I can't get the ICE to occur. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #6 from dominiq at lps dot ens dot fr 2007-02-15 21:43 --- I have the ICE pr25252.f90:6.46: MODULE PROCEDURE sreal, schar, sint = sreal 1 Error: Syntax error in MODULE PROCEDURE statement at (1) pr25252.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. with Using built-in specs. Target: i386-pc-linux-gnu Configured with: /home/fxcoudert/gfortran_nightbuild/trunk/configure --prefix=/home/fxcoudert/gfortran_nightbuild/irun-20070209 --enable-languages=c,fortran --host=i386-pc-linux-gnu --enable-checking=release --with-gmp=/home/fxcoudert/gfortran_nightbuild/software Thread model: posix gcc version 4.3.0 20070209 (experimental) but not with Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=/var/tmp/gfortran-20061231/irun --enable-languages=c,fortran --with-gmp=/var/tmp/gfortran-20061231/gfortran_libs Thread model: posix gcc version 4.3.0 20061231 (experimental) nor with Using built-in specs. Target: powerpc-apple-darwin7 Configured with: ../gcc-4.3-20070210/configure --prefix=/sw --prefix=/sw/lib/gcc4 --disable-multilib --enable-languages=c,c++,fortran,objc,java --infodir=/sw/lib/gcc4/share/info --with-gmp=/sw --with-included-gettext --build=powerpc-apple-darwin7 --host=powerpc-apple-darwin7 --with-as=/sw/lib/odcctools/bin/as --with-ld=/sw/lib/odcctools/bin/ld --with-nm=/sw/lib/odcctools/bin/nm --with-ar=/sw/lib/odcctools/bin/ar --with-strip=/sw/lib/odcctools/bin/strip --with-ranlib=/sw/lib/odcctools/bin/ranlib Thread model: posix gcc version 4.3.0 20070209 (experimental) and Using built-in specs. Target: powerpc-apple-darwin8 Configured with: ../gcc-4.2-20070124/configure --prefix=/sw --prefix=/sw/lib/gcc4.2 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --host=powerpc-apple-darwin8 --with-as=/sw/lib/odcctools/bin/as --with-ld=/sw/lib/odcctools/bin/ld --with-nm=/sw/lib/odcctools/bin/nm --with-gmp=/sw --with-libiconv-prefix=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib Thread model: posix gcc version 4.2.0 20070124 (prerelease) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #4 from pault at gcc dot gnu dot org 2006-09-16 20:06 --- GNU F95 version 4.2.0 20060916 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.2.0 20060916 (experimental). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 In file pr25252.f90:6 MODULE PROCEDURE sreal, schar, sint = sreal 1 Error: Syntax error in MODULE PROCEDURE statement at (1) pr25252.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. I think not, Steve. Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #3 from kargl at gcc dot gnu dot org 2006-08-29 21:39 --- We no longer get an ICE with GNU F95 version 4.2.0 20060828 (experimental) (x86_64-unknown-freebsd7.0) gfortran -o z ji.f90 In file ji.f90:6 MODULE PROCEDURE sreal, schar, sint = sreal 1 Error: Syntax error in MODULE PROCEDURE statement at (1) In file ji.f90:9 SUBROUTINE sreal(a,b) 1 Error: Procedure 'b' in generic interface 'swap' at (1) is neither function nor subroutine In file ji.f90:19 USE gswap 1 Fatal Error: Can't open module file 'gswap.mod' for reading at (1): No such file or directory Can we close this PR? -- kargl at gcc dot gnu dot org changed: What|Removed |Added CC||kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252
[Bug fortran/25252] ICE on invalid code
--- Comment #2 from dje at gcc dot gnu dot org 2006-01-03 16:25 --- Not powerpc-specific. -- dje at gcc dot gnu dot org changed: What|Removed |Added 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
[Bug fortran/25252] ICE on invalid code
--- Comment #1 from eedelman at gcc dot gnu dot org 2005-12-10 20:30 --- Confirmed. -- eedelman at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||ice-on-invalid-code Last reconfirmed|-00-00 00:00:00 |2005-12-10 20:30:00 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25252