https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82084

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, we could simply reject STRING_CSTs in vectorizable_store:

Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c       (revision 251559)
+++ gcc/tree-vect-stmts.c       (working copy)
@@ -5733,6 +5733,16 @@ vectorizable_store (gimple *stmt, gimple

   op = gimple_assign_rhs1 (stmt);

+  /* In the case this is a store from a STRING_CST make sure
+     native_encode_expr can handle it.  */
+  if (TREE_CODE (op) == STRING_CST
+      && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
+         || TREE_CODE (TREE_TYPE (TREE_TYPE (op))) != INTEGER_TYPE
+         || (GET_MODE_BITSIZE
+               (SCALAR_INT_TYPE_MODE (TREE_TYPE (TREE_TYPE (op))))
+             != BITS_PER_UNIT)))
+    return false;
+
   if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt, &rhs_vectype))
     {
       if (dump_enabled_p ())

probably best for branches.

Reply via email to