This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE in predicate_mem_writes (PR tree-optimization/70725)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 Apr 2016 12:54:12 +0200
- Subject: Re: [PATCH] Fix ICE in predicate_mem_writes (PR tree-optimization/70725)
- Authentication-results: sourceware.org; auth=none
- References: <20160419183549 dot GN28445 at redhat dot com> <CAFiYyc0rjGa2nR6M7kYyL0e_JUbM8w6HAGSRpHrW1i8H=8T_kw at mail dot gmail dot com> <20160420103711 dot GE2850 at laptop dot zalov dot cz>
On Wed, Apr 20, 2016 at 12:37 PM, Jakub Jelinek <jakub@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