This is the mail archive of the 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: vectorization ICE for aarch64/armhf on SPEC2006 h264ref

On Tue, Jan 12, 2016 at 11:05 PM, Jim Wilson <> wrote:
> On Tue, Jan 12, 2016 at 2:22 PM, Jim Wilson <> 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))
>        && 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.


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