This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement -Wduplicated-branches (PR c/64279) (v3)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Thu, 3 Nov 2016 12:24:47 +0100
- Subject: Re: Implement -Wduplicated-branches (PR c/64279) (v3)
- Authentication-results: sourceware.org; auth=none
- References: <20161019110707.GJ2576@redhat.com> <20161020102835.GM2576@redhat.com> <20161024141018.GD5939@redhat.com> <20161025135919.GJ5939@redhat.com> <CADzB+2nFxXywkHK5dVWKR9i9zKCwne6YWKdo531xynGFVpB6Rw@mail.gmail.com> <20161101135358.GP3541@tucnak.redhat.com>
On Tue, Nov 01, 2016 at 02:53:58PM +0100, Jakub Jelinek wrote:
> On Tue, Nov 01, 2016 at 09:41:20AM -0400, Jason Merrill wrote:
> > On Tue, Oct 25, 2016 at 9:59 AM, Marek Polacek <polacek@redhat.com> wrote:
> > > On Mon, Oct 24, 2016 at 04:10:21PM +0200, Marek Polacek wrote:
> > >> On Thu, Oct 20, 2016 at 12:28:36PM +0200, Marek Polacek wrote:
> > >> > I found a problem with this patch--we can't call do_warn_duplicated_branches in
> > >> > build_conditional_expr, because that way the C++-specific codes might leak into
> > >> > the hasher. Instead, I should use operand_equal_p, I think. Let me rework
> > >> > that part of the patch.
> >
> > Hmm, is there a reason not to use operand_equal_p for
> > do_warn_duplicated_branches as well? I'm concerned about hash
> > collisions leading to false positives.
>
> If the hashing function is iterative_hash_expr / inchash::add_expr, then
> that is supposed to pair together with operand_equal_p, we even have
> checking verification of that.
Yes, I use inchash::add_expr.
So any opinions as to what to do with this patch?
Marek