Hello, > Dear mailing list, > > is there something wrong with the following code? > -- > basic_block my_basic_block; > basic_block dup_basic_block; > > FOR_EACH_BB(my_basic_block) > { > dup_basic_block = duplicate_block(bb, NULL); > }
I assume you mean > dup_basic_block = duplicate_block(my_basic_block, NULL); Then, this code is quite likely to cause an infinite loop, duplicating also the newly created basic blocks. I however have no idea how this could cause the ICE you describe below. Zdenek > -- > I get an ICE in get_indirect_ref_operands, with the backtrace: > -- > #0 0x0000000100175688 in get_indirect_ref_operands > (stmt=0xffffffff7ea0c640, expr=0xffffffff7eaf8100, flags=0) > at ../../gcc-4.0.1/gcc/tree-ssa-operands.c:1417 > #1 0x0000000100173dcc in get_expr_operands (stmt=0xffffffff7ea0c640, > expr_p=0xffffffff7ea0c3f8, flags=0) > at ../../gcc-4.0.1/gcc/tree-ssa-operands.c:1091 > #2 0x000000010017406c in get_expr_operands (stmt=0xffffffff7ea0c640, > expr_p=0xffffffff7ea0c680, flags=0) > at ../../gcc-4.0.1/gcc/tree-ssa-operands.c:1134 > #3 0x0000000100172f94 in build_ssa_operands > (stmt=0xffffffff7ea0c640, ann=0xffffffff7eaf6850, > old_ops=0xffffffff7fffcd90, > new_ops=0xffffffff7eaf6878) at ../../gcc-4.0.1/gcc/tree-ssa- > operands.c:906 > #4 0x0000000100173b20 in get_stmt_operands (stmt=0xffffffff7ea0c640) > at ../../gcc-4.0.1/gcc/tree-ssa-operands.c:1021 > #5 0x000000010010ca18 in tree_duplicate_bb (bb=0xffffffff7eafbe10) > at ../../gcc-4.0.1/gcc/tree-cfg.c:4684 > #6 0x0000000100591ea8 in duplicate_block (bb=0xffffffff7eafbe10, > e=0x0) at ../../gcc-4.0.1/gcc/cfghooks.c:717 > ... > -- > The context is a tree optimization pass, with PROP_gimple_any | > PROP_ssa | PROP_cfg | PROP_referenced_vars required. > > Sincerely, > Sean Callanan