This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR86544] Fix Popcount detection generates different code on C and C++
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Kugan Vivekanandarajah <kugan dot vivekanandarajah at linaro dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Jul 2018 11:55:11 +0200
- Subject: Re: [PR86544] Fix Popcount detection generates different code on C and C++
- References: <CAELXzTMBKQ1xjW7rskYfuZeM5d1RrUC1BpQtQK-EQw5f3nyYog@mail.gmail.com>
On Wed, Jul 18, 2018 at 4:19 AM Kugan Vivekanandarajah
<kugan.vivekanandarajah@linaro.org> wrote:
>
> Attached patch fixes phi-opt not optimizing c++ testcase where we have
>
> if (b_4(D) == 0) instead of if (b_4(D) != 0) as shown in
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86544
>
> Patch bootstrapped and regression tested on x86_64-linux-gnu with no
> new regressions.
>
> Is this OK for trunk?
OK.
Richard.
> Thanks,
> Kugan
>
> gcc/ChangeLog:
>
> 2018-07-18 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> PR middle-end/86544
> * tree-ssa-phiopt.c (cond_removal_in_popcount_pattern): Handle
> comparison with EQ_EXPR
> in last stmt.
>
> gcc/testsuite/ChangeLog:
>
> 2018-07-18 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> PR middle-end/86544
> * g++.dg/tree-ssa/pr86544.C: New test.