This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][simplify-rtx] PR 65235: Calculate element size correctly when simplifying (vec_select (vec_concat (const_int) (...)) [...])
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Mar 2015 14:33:13 +0100
- Subject: Re: [PATCH][simplify-rtx] PR 65235: Calculate element size correctly when simplifying (vec_select (vec_concat (const_int) (...)) [...])
- Authentication-results: sourceware.org; auth=none
- References: <54F6D239 dot 2010902 at arm dot com> <5304338 dot pAnzusuvRk at polaris> <5501947D dot 5020208 at arm dot com>
On Thu, Mar 12, 2015 at 2:28 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>>> The patch fixes that by calculating the size of the first element by
>>> taking the size of the outer mode and subtracting the size of the second
>>> element.
>>>
>>> I've added an assert to make sure that the second element is not also a
>>> const_int, as a vec_concat of const_ints doesn't make sense as far as I
>>> can
>>> see.
>>
>> I'm not sure about the assert, can't we just punt in this case?
>
> Ok, here's a patch returning 0 in that case.
> The assert had never triggered in my testing anyway, but I agree we
> want to just cancel the simplification rather than ICE.
>
>>
>>> Bootstrapped and tested on aarch64-none-linux-gnu,
>>> arm-none-linux-gnueabihf, x86_64-linux-gnu.
>>> This bug appears on trunk, 4.9 and 4.8, so it's not a regression on the
>>> release branches but it is a wrong-code bug.
>>
>> I think that the fix would be acceptable for GCC 5 without the assert.
>>
>
> Thanks for reviewing.
> Richard, do you think this can go in for GCC 5 now?
> What about 4.9 and 4.8? The bug appears there as well.
Sure - it's a wrong-code fix. Ok for trunk and branches (after a while).
Thanks,
Richard.
> Thanks,
> Kyrill
>
>
> 2015-03-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> PR rtl-optimization 65235
> * simplify-rtx.c (simplify_binary_operation_1, VEC_SELECT case):
> When first element of vec_concat is const_int, calculate its size
> using second element.
>
> 2015-03-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
>
> PR rtl-optimization 65235
> * gcc.target/aarch64/pr65235_1.c: New test.