On Wed, Apr 20, 2016 at 12:37 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Wed, Apr 20, 2016 at 11:04:08AM +0200, Richard Biener wrote:
>> > --- gcc/tree-if-conv.c
>> > +++ gcc/tree-if-conv.c
>> > @@ -262,6 +262,16 @@ ifc_temp_var (tree type, tree expr, 
>> > gimple_stmt_iterator *gsi)
>> >    return new_name;
>> >  }
>> >
>> > +/* Return true when COND is a false predicate.  */
>> > +
>> > +static inline bool
>> > +is_false_predicate (tree cond)
>> > +{
>> > +  return (cond == NULL_TREE
>> > +         || cond == boolean_false_node
>> > +         || integer_zerop (cond));
>> > +}
>> > +
>
> Is it really a good idea to return true even for cond == NULL_TREE?
> I mean it is then very confusing, because both is_true_predicate and
> is_false_predicate are true in that case.

Ah, indeed.  NULL_TREE is true, not false.

> It doesn't make a difference when both are used in ||, but looks really
> weird and makes the occassional reader wonder if NULL_TREE is valid there at
> all and what exactly it means.
>
>> >  /* Return true when COND is a true predicate.  */
>> >
>> >  static inline bool
>> > @@ -1988,7 +1998,7 @@ predicate_mem_writes (loop_p loop)
>> >        gimple *stmt;
>> >        int index;
>> >
>> > -      if (is_true_predicate (cond))
>> > +      if (is_true_predicate (cond) || is_false_predicate (cond))
>> >         continue;
>> >
>> >        swap = false;
>> >
>> >         Marek
>
>         Jakub

Reply via email to