the attached code causes the compiler to segfault as:
Program received signal SIGSEGV, Segmentation fault.
bitmap_clear (head=0x78) at /data03/vondele/gcc_trunk/gcc/gcc/bitmap.c:297
297 if (head->first)
(gdb) bt
#0 bitmap_clear (head=0x78) at /data03/vondele/gcc_trunk/gcc/gcc/bitmap.c:297
#1 0x0000000000738265 in move_loop_invariants () at
/data03/vondele/gcc_trunk/gcc/gcc/loop-invariant.c:1568
#2 0x0000000000734e8d in rtl_move_loop_invariants () at
/data03/vondele/gcc_trunk/gcc/gcc/loop-init.c:254
#3 0x0000000000770fd4 in execute_one_pass (pass=0x11c1480) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1518
#4 0x00000000007711e5 in execute_pass_list (pass=0x11c1480) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1567
#5 0x00000000007711fd in execute_pass_list (pass=0x11c1360) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1568
#6 0x00000000007711fd in execute_pass_list (pass=0x1242580) at
/data03/vondele/gcc_trunk/gcc/gcc/passes.c:1568
#7 0x000000000086c0e1 in tree_rest_of_compilation (fndecl=0x7fdb5deb3d00) at
/data03/vondele/gcc_trunk/gcc/gcc/tree-optimize.c:392
#8 0x00000000009e806d in cgraph_expand_function (node=0x7fdb5ddc8300) at
/data03/vondele/gcc_trunk/gcc/gcc/cgraphunit.c:1160
#9 0x00000000009eaa24 in cgraph_optimize () at
/data03/vondele/gcc_trunk/gcc/gcc/cgraphunit.c:1219
#10 0x00000000009eb3ad in cgraph_finalize_compilation_unit () at
/data03/vondele/gcc_trunk/gcc/gcc/cgraphunit.c:1089
#11 0x000000000073325d in write_global_declarations () at
/data03/vondele/gcc_trunk/gcc/gcc/langhooks.c:309
#12 0x000000000081781e in toplev_main (argc=27, argv=0x7fff67e09dc8) at
/data03/vondele/gcc_trunk/gcc/gcc/toplev.c:1061
when compiled with:
gfortran -c -O1 -march=native -g -ffree-form -fbounds-check
more details:
> gfortran -c -O1 -march=native -g -ffree-form -fbounds-check -v bug.f90
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /data03/vondele/gcc_trunk/gcc/configure --disable-bootstrap
--prefix=/data03/vondele/gcc_trunk/build --enable-languages=c,c++,fortran
--disable-multilib --with-ppl=/data03/vondele/gcc_trunk/build/
--with-cloog=/data03/vondele/gcc_trunk/build/
--with-libelf=/data03/vondele/libelf-0.8.12/build/ --enable-gold --enable-lto
--enable-plugins
Thread model: posix
gcc version 4.5.0 20091103 (experimental) [trunk revision 153852] (GCC)
COLLECT_GCC_OPTIONS='-c' '-O1' '-g' '-ffree-form' '-fbounds-check' '-v'
/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/f951
bug.f90 -march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param
l1-cache-line-size=64 --param l2-cache-size=1024 -mtune=k8 -quiet -dumpbase
bug.f90 -auxbase bug -g -O1 -version -ffree-form -fbounds-check
-fintrinsic-modules-path
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/finclude
-o /tmp/ccSGzPfe.s
GNU Fortran (GCC) version 4.5.0 20091103 (experimental) [trunk revision 153852]
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.3.1 20080507 (prerelease) [gcc-4_3-branch
revision 135036], GMP version 4.2.2, MPFR version 2.3.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.5.0 20091103 (experimental) [trunk revision 153852]
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.3.1 20080507 (prerelease) [gcc-4_3-branch
revision 135036], GMP version 4.2.2, MPFR version 2.3.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
bug.f90: In function ‘moment’:
bug.f90:124:0: 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.
--
Summary: segfault at gcc/bitmap.c:297
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jv244 at cam dot ac dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41928