This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix a typo in range_entry_cmp (PR tree-optimization/61686)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 10 Dec 2014 09:11:23 +0100
- Subject: Re: [PATCH] Fix a typo in range_entry_cmp (PR tree-optimization/61686)
- Authentication-results: sourceware.org; auth=none
- References: <20141210065746 dot GR16332 at redhat dot com> <20141210075909 dot GV1667 at tucnak dot redhat dot com>
On Wed, Dec 10, 2014 at 08:59:09AM +0100, Jakub Jelinek wrote:
> On Wed, Dec 10, 2014 at 07:57:46AM +0100, Marek Polacek wrote:
> > I don't really know this code, but this typo looks obvious enough.
> > Using if (p->high != NULL_TREE) ... else if (p->high != NULL_TREE)
> > couldn't be possibly desired, so use Q in the else branch, as in
> > the code slightly above.
> >
> > Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?
> >
> > 2014-12-10 Marek Polacek <polacek@redhat.com>
> >
> > PR tree-optimization/61686
> > * tree-ssa-reassoc.c (range_entry_cmp): Use q->high instead of
> > p->high.
>
> Ok for trunk/4.9/4.8. Shouldn't we have a FE warning for this kind of thing?
> I mean
> if (conditionX)
> {
> }
> else if (conditionY)
> ...
> when the two conditions don't have side-effects and are operand_equal_p?
Yes, we should, I'll file a PR. Not sure whether such a warning is
stage 3 material.
Thanks,
Marek