This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][simplify-rtx] PR 65235: Calculate element size correctly when simplifying (vec_select (vec_concat (const_int) (...)) [...])


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]