[Bug middle-end/71893] New: gfortran.dg ICEs in gcc/tree-ssa-pre.c; -fcode-hoisting?
tschwinge at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 15 10:50:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71893
Bug ID: 71893
Summary: gfortran.dg ICEs in gcc/tree-ssa-pre.c;
-fcode-hoisting?
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org, steven at gcc dot gnu.org
Target Milestone: ---
Target: nvptx
Testing gfortran.dg for nvptx-none on r238326, there are a number of ICEs in
gcc/tree-ssa-pre.c. I reproduced "gfortran.dg/bounds_check_10.f90 -O2"
manually, and the ICE disappears when reverting r238242, or when specifying
-fno-code-hoisting. (Of course, it may be a latent issue, just now exposed by
-fcode-hoisting.)
Program received signal SIGSEGV, Segmentation fault.
0x0000000000cfcb6e in get_expr_value_id (expr=expr@entry=0x0) at
[...]/source-gcc/gcc/tree-ssa-pre.c:682
682 switch (expr->kind)
(gdb) bt
#0 0x0000000000cfcb6e in get_expr_value_id (expr=expr@entry=0x0) at
[...]/source-gcc/gcc/tree-ssa-pre.c:682
#1 0x0000000000d058a2 in find_or_generate_expression
(block=block@entry=0x7ffff68f2680, op=op@entry=0x7ffff697f3a0,
stmts=stmts@entry=0x7fffffffca70) at [...]/source-gcc/gcc/tree-ssa-pre.c:2672
#2 0x0000000000d06454 in create_component_ref_by_pieces_1
(block=block@entry=0x7ffff68f2680, ref=ref@entry=0x17ef190,
operand=operand@entry=0x7fffffffc82c, stmts=stmts@entry=0x7fffffffca70) at
[...]/source-gcc/gcc/tree-ssa-pre.c:2590
#3 0x0000000000d06190 in create_component_ref_by_pieces_1
(block=block@entry=0x7ffff68f2680, ref=ref@entry=0x17ef190,
operand=operand@entry=0x7fffffffc82c, stmts=stmts@entry=0x7fffffffca70) at
[...]/source-gcc/gcc/tree-ssa-pre.c:2556
#4 0x0000000000d05f42 in create_component_ref_by_pieces_1
(block=block@entry=0x7ffff68f2680, ref=ref@entry=0x17ef190,
operand=operand@entry=0x7fffffffc82c, stmts=stmts@entry=0x7fffffffca70) at
[...]/source-gcc/gcc/tree-ssa-pre.c:2514
#5 0x0000000000d06647 in create_component_ref_by_pieces
(block=block@entry=0x7ffff68f2680, ref=0x17ef190,
stmts=stmts@entry=0x7fffffffca70) at [...]/source-gcc/gcc/tree-ssa-pre.c:2657
#6 0x0000000000d06a45 in create_expression_by_pieces
(block=block@entry=0x7ffff68f2680, expr=0x190a088,
stmts=stmts@entry=0x7fffffffca70, type=0x7ffff68e2b28) at
[...]/source-gcc/gcc/tree-ssa-pre.c:2799
#7 0x0000000000d08483 in do_hoist_insertion
(block=block@entry=0x7ffff68f2680) at [...]/source-gcc/gcc/tree-ssa-pre.c:3541
#8 0x0000000000d0b54e in insert_aux (block=block@entry=0x7ffff68f2680,
do_pre=do_pre@entry=true, do_hoist=do_hoist@entry=true) at
[...]/source-gcc/gcc/tree-ssa-pre.c:3615
#9 0x0000000000d0b592 in insert_aux (block=block@entry=0x7ffff68f2618,
do_pre=do_pre@entry=true, do_hoist=do_hoist@entry=true) at
[...]/source-gcc/gcc/tree-ssa-pre.c:3622
#10 0x0000000000d0b592 in insert_aux (block=0x7ffff68f2548,
do_pre=<optimized out>, do_hoist=<optimized out>) at
[...]/source-gcc/gcc/tree-ssa-pre.c:3622
#11 0x0000000000d0b693 in insert () at
[...]/source-gcc/gcc/tree-ssa-pre.c:3646
#12 0x0000000000d0ba06 in (anonymous namespace)::pass_pre::execute
(this=0x1752760, fun=0x7ffff69575e8) at
[...]/source-gcc/gcc/tree-ssa-pre.c:5011
#13 0x0000000000a9b6cd in execute_one_pass (pass=pass@entry=0x1752760) at
[...]/source-gcc/gcc/passes.c:2344
#14 0x0000000000a9bce8 in execute_pass_list_1 (pass=0x1752760) at
[...]/source-gcc/gcc/passes.c:2428
#15 0x0000000000a9bcfa in execute_pass_list_1 (pass=0x17516e0) at
[...]/source-gcc/gcc/passes.c:2429
#16 0x0000000000a9bd45 in execute_pass_list (fn=0x7ffff69575e8,
pass=<optimized out>) at [...]/source-gcc/gcc/passes.c:2439
#17 0x00000000007541ad in cgraph_node::expand
(this=this@entry=0x7ffff695d000) at [...]/source-gcc/gcc/cgraphunit.c:1983
#18 0x0000000000755c84 in expand_all_functions () at
[...]/source-gcc/gcc/cgraphunit.c:2119
#19 symbol_table::compile (this=this@entry=0x7ffff68d2000) at
[...]/source-gcc/gcc/cgraphunit.c:2475
#20 0x0000000000757e7a in symbol_table::finalize_compilation_unit
(this=0x7ffff68d2000) at [...]/source-gcc/gcc/cgraphunit.c:2565
#21 0x0000000000b639ad in compile_file () at
[...]/source-gcc/gcc/toplev.c:490
#22 0x0000000000562eeb in do_compile () at
[...]/source-gcc/gcc/toplev.c:1998
#23 toplev::main (this=this@entry=0x7fffffffce50, argc=argc@entry=18,
argv=argv@entry=0x7fffffffcf58) at [...]/source-gcc/gcc/toplev.c:2132
#24 0x0000000000564a87 in main (argc=18, argv=0x7fffffffcf58) at
[...]/source-gcc/gcc/main.c:39
(gdb) frame 1
#1 0x0000000000d058a2 in find_or_generate_expression
(block=block@entry=0x7ffff68f2680, op=op@entry=0x7ffff697f3a0,
stmts=stmts@entry=0x7fffffffca70) at [...]/source-gcc/gcc/tree-ssa-pre.c:2672
2672 unsigned int lookfor = get_expr_value_id (expr);
Unexpectedly, "expr" is NULL, which has been returned from
"get_or_alloc_expr_for (op)" for the following "op":
(gdb) call debug_tree(op)
<nop_expr 0x7ffff697f3a0
type <integer_type 0x7ffff68d20a8 sizetype public unsigned DI
size <integer_cst 0x7ffff68cd378 constant 64>
unit size <integer_cst 0x7ffff68cd390 constant 8>
align 64 symtab 0 alias set -1 canonical type 0x7ffff68d20a8
precision 64 min <integer_cst 0x7ffff68cd3a8 0> max <integer_cst 0x7ffff68d6420
18446744073709551615>>
arg 0 <ssa_name 0x7ffff6956510
type <integer_type 0x7ffff68d2150 bitsizetype public unsigned DI
size <integer_cst 0x7ffff68cd378 64> unit size <integer_cst 0x7ffff68cd390 8>
align 64 symtab 0 alias set -1 canonical type 0x7ffff68d2150
precision 64 min <integer_cst 0x7ffff68cd3c0 0> max <integer_cst 0x7ffff68d6440
18446744073709551615>>
static visiteddef_stmt _3 = (bitsizetype) _34;
version 3
ptr-info 0x7ffff697a8a0>
source-gcc/gcc/testsuite/gfortran.dg/array_constructor_type_10.f03:18:0
start: source-gcc/gcc/testsuite/gfortran.dg/array_constructor_type_10.f03:18:0
finish:
source-gcc/gcc/testsuite/gfortran.dg/array_constructor_type_10.f03:18:0>
Reacting to these symptoms, the following band-aid change:
find_or_generate_expression (basic_block block, tree op, gimple_seq
*stmts)
{
pre_expr expr = get_or_alloc_expr_for (op);
+ if (!expr)
+ return NULL_TREE;
unsigned int lookfor = get_expr_value_id (expr);
pre_expr leader = bitmap_find_leader (AVAIL_OUT (block), lookfor);
if (leader)
... resolves the ICE, but I don't know if that's an appropriate fix? (Testing
is running to see whether that resolves all of them.)
More information about the Gcc-bugs
mailing list