Hi All,

expand_vector_piecewise does not support VLA expansion as it has a hard assert
on the type not being VLA.

Instead of just failing to expand and so the call marked unsupported we ICE.
This adjust it so we don't and can gracefully handle the expansion in support
checks.

Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.

Ok for master?

Thanks,
Tamar

gcc/ChangeLog:

        * tree-vect-generic.cc (expand_vector_comparison): Skip piecewise if not
        constant.

--- inline copy of patch -- 
diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc
index 
df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6ed0b2f4c3c222d58a8d
 100644
--- a/gcc/tree-vect-generic.cc
+++ b/gcc/tree-vect-generic.cc
@@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree 
type, tree op0,
            }
          t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t);
        }
-      else
+      else if (TYPE_VECTOR_SUBPARTS (type).is_constant ())
        t = expand_vector_piecewise (gsi, do_compare, type,
                                     TREE_TYPE (TREE_TYPE (op0)), op0, op1,
                                     code, false);




-- 
diff --git a/gcc/tree-vect-generic.cc b/gcc/tree-vect-generic.cc
index 
df04a0db68da3222f43dd938f8e7adb186cd93c9..da1fd2f40d82a9fa301e6ed0b2f4c3c222d58a8d
 100644
--- a/gcc/tree-vect-generic.cc
+++ b/gcc/tree-vect-generic.cc
@@ -481,7 +481,7 @@ expand_vector_comparison (gimple_stmt_iterator *gsi, tree 
type, tree op0,
            }
          t = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t);
        }
-      else
+      else if (TYPE_VECTOR_SUBPARTS (type).is_constant ())
        t = expand_vector_piecewise (gsi, do_compare, type,
                                     TREE_TYPE (TREE_TYPE (op0)), op0, op1,
                                     code, false);



Reply via email to