On Thu, Mar 12, 2015 at 2:28 PM, Kyrill Tkachov <kyrylo.tkac...@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.tkac...@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.tkac...@arm.com> > > > PR rtl-optimization 65235 > * gcc.target/aarch64/pr65235_1.c: New test.