On Thu, Jul 14, 2016 at 6:49 PM, Jeff Law <law@redhat.com> wrote:
On 07/14/2016 10:12 AM, Bin Cheng wrote:
Hi,
This is a simple patch fixing ICE in tree-if-conv.c. Existing code does
not setup a variable (cond) when predicate of basic block is true and it
asserts on the variable. Interesting thing is dead code is not cleaned up
before ifcvt, but that's another story.
Bootstrap and test on x86_64. Is it OK?
Thanks,
bin
2016-07-13 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/71503
PR tree-optimization/71683
* tree-if-conv.c (gen_phi_arg_condition): Set cond when predicate
is true.
Maybe I'm missing something, but in the case where we COND is already set
and we encounter a true predicate later, shouldn't that make the result true
as well?
Yes, this is my understanding too, if the case does exist. To my
understanding, conditions for phi arguments should be complimentary to
others. If one argument has true predicate, then other must? be
false, then the case doesn't exist.
I don't think the code will though -- we just throw away the true condition.
ISTM that the right thing to do is
if (is_true_predicate (c))
{
cond = c;
continue;
}
Anyway, I think we can make it more robust/efficient by using:
if (is_true_predicate (c))
{
cond = c;
break;
}
What do you think? Actually we should discard other arguments if one
has true predicate.