Comment 3 for bug 972648

Revision history for this message
Michael Hope (michaelh1) wrote :

Thank you for the bug report. I've confirmed this with gcc-linaro-4.6-2012.03+bzr106882 on x86_64:

michaelh@crucis:~/linaro/gcc/build/native-4.6/gcc$ PATH=$PWD:$PATH ./xgcc -O3 ~/linaro/bugs/sparsmat.ii
sparsmat.cc: In function ‘long int smExpBound(ideal, int, int, int)’:
sparsmat.cc:216:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
sparsmat.cc:217:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
sparsmat.cc: In function ‘BOOLEAN _ZL11smIsNegQuotP8spolyrecS0_S0_.part.12(poly, poly, poly)’:
sparsmat.cc:1948:16: internal compiler error: Segmentation fault

The fault is exposed by the tree vectoriser. The work-around is to compile with -fno-tree-vectorize or to drop down to -O2. I'll try to reproduce it in the upstream branches.

I've set it to medium priority as it is a ftbfs, has a work around, and occurs at high optimisation levels.

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
gsi_for_stmt (stmt=0x7ffff462d5f0) at ../../../4.6/gcc/gimple-iterator.c:552
552 i = gsi_start_phis (bb);
(gdb) back
#0 gsi_for_stmt (stmt=0x7ffff462d5f0) at ../../../4.6/gcc/gimple-iterator.c:552
#1 0x00000000004935be in cond_if_else_store_replacement_1 (else_assign=0x7ffff462d5f0,
    then_assign=0x7ffff462d370, join_bb=0x7ffff462b0d0, then_bb=<optimized out>,
    else_bb=<optimized out>) at ../../../4.6/gcc/tree-ssa-phiopt.c:1337
#2 cond_if_else_store_replacement_1 (join_bb=0x7ffff462b0d0, then_assign=0x7ffff462d370,
    else_assign=0x7ffff462d5f0, then_bb=<optimized out>, else_bb=<optimized out>)
    at ../../../4.6/gcc/tree-ssa-phiopt.c:1300
#3 0x000000000086b013 in cond_if_else_store_replacement (join_bb=0x7ffff462b0d0,
    else_bb=0x7ffff462b068, then_bb=<optimized out>) at ../../../4.6/gcc/tree-ssa-phiopt.c:1542
#4 tree_ssa_phiopt_worker (do_store_elim=1 '\001') at ../../../4.6/gcc/tree-ssa-phiopt.c:283
#5 0x0000000000737329 in execute_one_pass (pass=0x11a5da0) at ../../../4.6/gcc/passes.c:1556
#6 0x00000000007375e5 in execute_pass_list (pass=0x11a5da0) at ../../../4.6/gcc/passes.c:1611
#7 0x00000000007375f7 in execute_pass_list (pass=0x11a4e40) at ../../../4.6/gcc/passes.c:1612
#8 0x0000000000804e21 in tree_rest_of_compilation (fndecl=0x7ffff4614600)
    at ../../../4.6/gcc/tree-optimize.c:422
#9 0x0000000000949f2f in cgraph_expand_function (node=0x7ffff7ebadc0)
    at ../../../4.6/gcc/cgraphunit.c:1576
#10 0x000000000094bbda in cgraph_expand_all_functions () at ../../../4.6/gcc/cgraphunit.c:1635
#11 cgraph_optimize () at ../../../4.6/gcc/cgraphunit.c:1899
#12 0x000000000094bfda in cgraph_finalize_compilation_unit () at ../../../4.6/gcc/cgraphunit.c:1096
#13 0x00000000004faf21 in cp_write_global_declarations () at ../../../4.6/gcc/cp/decl2.c:4000
#14 0x00000000007c94a2 in compile_file () at ../../../4.6/gcc/toplev.c:591
#15 do_compile () at ../../../4.6/gcc/toplev.c:1900
#16 toplev_main (argc=3, argv=0x7fffffffe118) at ../../../4.6/gcc/toplev.c:1963