http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57461
Bug ID: 57461 Summary: Ice on valid: lookup_page_table_entry, depending on details like (length of?) identifier names, file name of source file Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: bugs at stellardeath dot org Created attachment 30220 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30220&action=edit "Minimal" test case, has to be named e.g. input.f90 (or another 5char + ".f90" name) to trigger the ICE Trying out a self-compiled gfortran from a few days ago (see below for --version), I stumbled upon an ICE on the attached (apparently) valid code. The ice only happens with _all_ of the following flags: -fbounds-check -finit-real=snan -g3 -fopenmp Unfortunately, the "minimal" example I reduced out of our code (~10000 lines) with "delta" is with 484 lines still rather large. Is seems mostly to contain an object-oriented module used for timings and some of our helper functions to abort the program with debug prints. Note that the ICE seems incredibly sensitive, when I tried to manually simplify the example code, I discovered that if I do any of the following, the ICE disappears: - Remove the empty and unused module "foomod" in the first few lines - Rewrite the subroutine "raise_warning_x" to only accept one argument - Change the name of the subroutine "foobar_pwr2" to "foobar_pwr" - Remove any of the compilation flags given above What struck me as most odd: - If I renamed the file from input.f90 to minimal.f90, it compiled! I experimented a bit with this, and the filename seems to have to be 5 characters + ".f90", otherwise it compiles... I really hope anyone can reproduce this bug :) (I could trigger it on at least 3 different machines, however it was always a self-compiled version from trunk, maybe I screwed something up there.) Here is the output of a compilation (see attached file for input.f90): > gfortran -fbounds-check -finit-real=snan -g3 -fopenmp -c input.f90 input.f90:293.16: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer input.f90:235.16: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer input.f90:258.22: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer input.f90: In function ‘btr_solve’: input.f90:438:0: internal compiler error: Segmentation fault end subroutine btr_solve ^ 0x9f09ef crash_signal ../.././gcc/toplev.c:333 0x6ab923 lookup_page_table_entry ../.././gcc/ggc-page.c:593 0x6ab923 ggc_set_mark(void const*) ../.././gcc/ggc-page.c:1467 0x89e311 gt_ggc_mx_loop(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:893 0x89da69 gt_ggc_mx_basic_block_def(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:1415 0x89dfc9 gt_ggc_mx_gimple_statement_d(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:1515 0x89f561 gt_ggc_mx_cgraph_edge(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:612 0x89f545 gt_ggc_mx_cgraph_edge(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:610 0x89f545 gt_ggc_mx_cgraph_edge(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:610 0x89f545 gt_ggc_mx_cgraph_edge(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:610 0x89f183 gt_ggc_mx_symtab_node_def(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:717 0x89f630 gt_ggc_m_P15symtab_node_def4htab(void*) /home/lorenz/src/gcc/host-x86_64-unknown-linux-gnu/gcc/gtype-desc.c:2908 0x850bd5 ggc_mark_root_tab ../.././gcc/ggc-common.c:133 0x850ed0 ggc_mark_roots() ../.././gcc/ggc-common.c:152 0x6abffe ggc_collect() ../.././gcc/ggc-page.c:2077 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. > > gfortran --version GNU Fortran (GCC) 4.9.0 20130523 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING > This is what happens for a non 5char + ".f90" filename: > cp input.f90 minimal.f90 > gfortran -fbounds-check -finit-real=snan -g3 -fopenmp -c minimal.f90 minimal.f90:293.16: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer minimal.f90:235.16: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer minimal.f90:258.22: !$ do i = 0, omp_get_level() 1 Warning: Deleted feature: End expression in DO loop at (1) must be integer > Note that the ICE disappears if I declare omp_get_level via "use omp_lib" (as was done in our original code). In the reduced file it seems that this has to be removed to trigger the ICE. I hope you can learn anything from this rather complex case, Lorenz