This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: vectorization ICE for aarch64/armhf on SPEC2006 h264ref
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Jim Wilson <jim dot wilson at linaro dot org>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 13 Jan 2016 01:06:02 -0800
- Subject: Re: vectorization ICE for aarch64/armhf on SPEC2006 h264ref
- Authentication-results: sourceware.org; auth=none
- References: <CABXYE2WDiDi-3mqdPpBOs=ntPQ8M+LmTa-gQdNFiVQRg2MzTjw at mail dot gmail dot com> <CABXYE2VyU0q2LyLf8L2y7fs91HpuMcv2eVkK-7f5YSjZ_u9gBQ at mail dot gmail dot com>
On Tue, Jan 12, 2016 at 11:05 PM, Jim Wilson <jim.wilson@linaro.org> wrote:
> On Tue, Jan 12, 2016 at 2:22 PM, Jim Wilson <jim.wilson@linaro.org> wrote:
>> I see a number of places in tree-vect-generic.c that add a
>> VIEW_CONVERT_EXPR if useless_type_convertsion_p is false. That should
>> work, except when I try this, I see that the VIEW_CONVERT_EXPR gets
>> converted to a NOP_EXPR by gimplify_build1, and gets stripped again.
>
> To elaborate on this a bit more, I see a number of places that do this
> if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_rhs)))
> new_rhs = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs),
> new_rhs);
>
> In match.pd, there is a rule to convert VIEW_CONVERT_EXPR to NOP_EXPR
> (simplify
> (view_convert @0)
> (if ((INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
> && (INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0)))
> && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0)))
> (convert @0)))
>
> But according to useless_type_conversion_p, there are two more
> conditions that need to be met, the signedness must be the same, and
> if one is boolean and one is not then the precision must be one. In
> my case, we have a 32-bit int type and a 32-bit boolean type. So
> useless_type_conversion_p is demanding a type conversion, but match.pd
> is converting the VIEW_CONVERT_EXPR to a NOP_EXPR, and gimplify_build1
> is stripping it. So there appears to be an inconsistency here.
Can you file a bug so it does not get lost (with a reduced testcase)?
The VIEW_CONVERT_EXPR to NOP_EXPR is correct as that does not remove
any conversion.
I don't think gimplify_build1 is stripping the nop_expr either as it
should be using useless_type_conversion_p there.
Also in C there is no 32bit boolean types only a 1 bit one (which
fills a 1 byte field). So something else is going wrong.
Thanks,
Andrew