On 29/10/13 14:54, Jakub Jelinek wrote: > +/* Return true if all imm uses of VAR are either in STMT, or > + feed (optionally through a chain of single imm uses) GIMPLE_COND > + in basic block COND_BB. */ > + > +static bool > +all_imm_uses_in_stmt_or_feed_cond (tree var, gimple stmt, basic_block > cond_bb) > +{ > + use_operand_p use_p, use2_p; > + imm_use_iterator iter; > + > + FOR_EACH_IMM_USE_FAST (use_p, iter, var) > + if (USE_STMT (use_p) != stmt) > + { > + gimple use_stmt = USE_STMT (use_p); > + if (is_gimple_debug (use_stmt)) > + continue; > + while (is_gimple_assign (use_stmt) > + && single_imm_use (gimple_assign_lhs (use_stmt), > + &use2_p, &use_stmt)) > + ; > + if (gimple_code (use_stmt) != GIMPLE_COND > + || gimple_bb (use_stmt) != cond_bb) > + return false; > + } > + return true; > +} > +
Jakub, with g++.dg/torture/pr54684.C and -fno-tree-tail-merge, I run into a sigsegv because of gimple_code (use_stmt) being called with use_stmt == NULL. Thanks, - Tom