The following causes an ICE: > cat bug.f90 MODULE dbcsr_work_operations TYPE dbcsr_type END TYPE dbcsr_type TYPE dbcsr_obj TYPE(dbcsr_type) :: m END TYPE dbcsr_obj CONTAINS SUBROUTINE dbcsr_finalize(matrix) TYPE(dbcsr_obj), INTENT(INOUT) :: matrix !$omp single !$omp parallel num_threads(1) CALL dbcsr_merge_data (matrix%m, sort_data ) !$omp end parallel !$omp end single END SUBROUTINE dbcsr_finalize END MODULE dbcsr_work_operations > gfortran -v -c -O0 -fopenmp -fexceptions bug.f90 Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /data03/vondele/gcc_4_4_branch/gcc/configure --prefix=/data03/vondele/gcc_4_4_branch/build --with-ppl=/data03/vondele/gcc_trunk/build/ --with-cloog=/data03/vondele/gcc_trunk/build/ --enable-languages=c,c++,fortran --disable-multilib Thread model: posix gcc version 4.4.4 20100421 (prerelease) [gcc-4_4-branch revision 158605] (GCC) COLLECT_GCC_OPTIONS='-v' '-c' '-O0' '-fopenmp' '-fexceptions' '-mtune=generic' '-pthread' /data03/vondele/gcc_4_4_branch/build/libexec/gcc/x86_64-unknown-linux-gnu/4.4.4/f951 bug.f90 -quiet -dumpbase bug.f90 -mtune=generic -auxbase bug -O0 -version -fopenmp -fexceptions -fintrinsic-modules-path /data03/vondele/gcc_4_4_branch/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.4/finclude -o /tmp/ccff06dK.s GNU Fortran (GCC) version 4.4.4 20100421 (prerelease) [gcc-4_4-branch revision 158605] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.4 20100421 (prerelease) [gcc-4_4-branch revision 158605], GMP version 4.2.2, MPFR version 2.3.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 bug.f90: In function ‘dbcsr_finalize’: bug.f90:12: internal compiler error: Segmentation fault
4.3.1 ([gcc-4_3-branch revision 135036]) does not fail, so marking as regression. 4.5.0 works as well with 4.4.4 I have this backtrace: (gdb) bt #0 bitmap_element_allocate (head=0x10284c0) at /data03/vondele/gcc_4_4_branch/gcc/gcc/bitmap.c:206 #1 0x00000000004d076c in bitmap_set_bit (head=0x10284c0, bit=<value optimized out>) at /data03/vondele/gcc_4_4_branch/gcc/gcc/bitmap.c:638 #2 0x00000000009ba0b0 in compute_dominance_frontiers (frontiers=0x1028440) at /data03/vondele/gcc_4_4_branch/gcc/gcc/cfganal.c:1278 #3 0x00000000006d5849 in rewrite_into_ssa () at /data03/vondele/gcc_4_4_branch/gcc/gcc/tree-into-ssa.c:2256 #4 0x00000000006171db in execute_one_pass (pass=0xf795c0) at /data03/vondele/gcc_4_4_branch/gcc/gcc/passes.c:1277 #5 0x0000000000617415 in execute_pass_list (pass=0xf795c0) at /data03/vondele/gcc_4_4_branch/gcc/gcc/passes.c:1326 #6 0x0000000000617735 in execute_ipa_pass_list (pass=0xf79800) at /data03/vondele/gcc_4_4_branch/gcc/gcc/passes.c:890 #7 0x0000000000805301 in cgraph_optimize () at /data03/vondele/gcc_4_4_branch/gcc/gcc/cgraphunit.c:1237 #8 0x0000000000490d6a in gfc_be_parse_file (set_yydebug=<value optimized out>) at /data03/vondele/gcc_4_4_branch/gcc/gcc/fortran/f95-lang.c:240 #9 0x00000000006a7fb4 in toplev_main (argc=<value optimized out>, argv=<value optimized out>) at /data03/vondele/gcc_4_4_branch/gcc/gcc/toplev.c:970 #10 0x00007f91de717436 in __libc_start_main () from /lib64/libc.so.6 #11 0x00000000004061a9 in _start ()
See patch at http://gcc.gnu.org/ml/fortran/2010-04/msg00222.html and follow up at PR 43837
(In reply to comment #2) > See patch at http://gcc.gnu.org/ml/fortran/2010-04/msg00222.html and follow up > at PR 43837 beats the speed of light... thanks. A very practical question. Is Fortran code compiled with -fexceptions necessarily miscompiled, or will it behave properly. The reason I'm asking (and found the bug) is that openmpi adds -fexceptions by default via the mpif90 script at compilation time.
Subject: Bug 43836 Author: jakub Date: Wed Apr 21 21:20:07 2010 New Revision: 158619 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158619 Log: PR fortran/43836 * f95-lang.c (gfc_define_builtin): Set TREE_NOTHROW on the decl. * gfortran.dg/gomp/pr43836.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/f95-lang.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 43836 Author: jakub Date: Wed Apr 21 21:24:04 2010 New Revision: 158620 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158620 Log: PR fortran/43836 * f95-lang.c (gfc_define_builtin): Set TREE_NOTHROW on the decl. * gfortran.dg/gomp/pr43836.f90: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 Modified: branches/gcc-4_5-branch/gcc/fortran/ChangeLog branches/gcc-4_5-branch/gcc/fortran/f95-lang.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Subject: Bug 43836 Author: jakub Date: Wed Apr 21 21:26:11 2010 New Revision: 158621 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158621 Log: PR fortran/43836 * f95-lang.c (gfc_define_builtin): Set TREE_NOTHROW on the decl. * gfortran.dg/gomp/pr43836.f90: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 Modified: branches/gcc-4_4-branch/gcc/fortran/ChangeLog branches/gcc-4_4-branch/gcc/fortran/f95-lang.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed for 4.4.4/4.5.1/4.6.0.