This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Handle __builtin_unreachable () using assertions in VRP
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Nov 2013 01:59:46 +0100
- Subject: Re: [PATCH] Handle __builtin_unreachable () using assertions in VRP
- Authentication-results: sourceware.org; auth=none
- References: <20131025090640 dot GF30970 at tucnak dot zalov dot cz> <alpine dot LNX dot 2 dot 00 dot 1310291219560 dot 11149 at zhemvz dot fhfr dot qr> <20131029135401 dot GC30970 at tucnak dot zalov dot cz>
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