This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: match.pd: x+x -> 2*x
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Apr 2016 14:00:23 +0200
- Subject: Re: match.pd: x+x -> 2*x
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 20 dot 1604251948200 dot 1881 at laptop-mg dot saclay dot inria dot fr> <CAFiYyc3Qn_p1U=BCb6sFV+p-nq+v72GFHcHXTY5uFh1NP9aPtg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1604261316210 dot 2084 at laptop-mg dot saclay dot inria dot fr>
On Tue, Apr 26, 2016 at 1:37 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Tue, 26 Apr 2016, Richard Biener wrote:
>
>> Note that I think
>>
>> /* (X /[ex] A) * A -> X. */
>> (simplify
>> (mult (convert? (exact_div @0 @1)) @1)
>> /* Look through a sign-changing conversion. */
>> (convert @0))
>>
>> has a bug as we use operand_equal_p for comparing @1 but
>> that treats equal but different typed INTEGER_CSTs as equal...
>>
>> Thus this lacks the tree_nop_conversion_p check.
>
>
> You seemed ok with removing that check last year
> https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01551.html
Ah, ok.
> For this specific pattern, I think any conversion should work. Did you have
> a particular example in mind?
No, I just saw the fold-const.c code again and wondered.
Richard.
> --
> Marc Glisse