Hi, 

        This is a simple fix for PR96195.

        For the test case, GCC generates the following gimple statement in 
pass_vect:

          vect__21.16_58 = zp.simdclone.2 (vect_vec_iv_.15_56);

        The mode of vect__21.16_58 is VNx2SI while the mode of zp.simdclone.2 
(vect_vec_iv_.15_56) is V4SI, resulting in the crash.

        In vectorizable_simd_clone_call, type compatibility is handled based on 
the number of elements and the type compatibility of elements, which is not 
enough. 
        This patch add VIEW_CONVERT_EXPRs if the arguments types and return 
type of simd clone function are distinct with the vectype of stmt.

        Added one testcase for this. Bootstrap and tested on both aarch64 and 
x86 Linux platform, no new regression witnessed.

        Ok for trunk?

Thanks,
Yang Yang


+2020-07-15  Yang Yang  <yangyang...@huawei.com>
+
+       PR tree-optimization/96195
+       * tree-vect-stmts.c (vectorizable_simd_clone_call): Add
+       VIEW_CONVERT_EXPRs if the arguments types and return type
+       of simd clone function are distinct with the vectype of stmt.
+

+2020-07-15  Yang Yang  <yangyang...@huawei.com>
+
+       PR tree-optimization/96195
+       * gcc.target/aarch64/sve/pr96195.c: New test.
+

Attachment: pr96195-v1.patch
Description: pr96195-v1.patch

Reply via email to