This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix ICE with -Wduplicated-branches (PR c/79199)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Jan 2017 12:25:25 +0100
- Subject: Re: Fix ICE with -Wduplicated-branches (PR c/79199)
- Authentication-results: sourceware.org; auth=none
- References: <20170126112102.GA6809@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jan 26, 2017 at 12:21:02PM +0100, Marek Polacek wrote:
> This testcase was breaking because we found ourselves in operand_equal_p
> with a COND_EXPR whose operand 2 was null -- i.e., missing else branch,
> which won't happen for ? : but can happen here via -Wduplicated-branches.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2017-01-26 Marek Polacek <polacek@redhat.com>
>
> PR c/79199
> * fold-const.c (operand_equal_p) [COND_EXPR]: Use OP_SAME_WITH_NULL
> for the third operand.
>
> * c-c++-common/Wduplicated-branches-13.c: New test.
Ok, thanks.
Jakub