https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127058
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
t.f90:6:5: note: node (external) 0x52fa480 (refcnt=1) vector(4) real(kind=4)
@_188 = (*A.11_43)[_180];
t.f90:6:5: note: { _66, _74, _87, _103, _112, _128, _143, _158, _174,
_188 }
(gdb) p vinfo->kind
$3 = vec_info::bb
(gdb) p number_of_vectors
$1 = 3
(gdb) p op_node->vec_defs.m_vec->m_vecpfx
$2 = {m_alloc = 3, m_using_auto_storage = 0, m_num = 3}
so we have 10 lanes and expect 3 vectors of V4SF with the last one padded.
This is used by
t.f90:6:5: note: node 0x52fa060 (refcnt=1) vector(2) real(kind=8) @_188 =
(*A.11_43)[_180];
t.f90:6:5: note: op template: _67 = (real(kind=8)) _66;
t.f90:6:5: note: stmt 0 _67 = (real(kind=8)) _66;
t.f90:6:5: note: stmt 1 _75 = (real(kind=8)) _74;
t.f90:6:5: note: stmt 2 _89 = (real(kind=8)) _87;
t.f90:6:5: note: stmt 3 _104 = (real(kind=8)) _103;
t.f90:6:5: note: stmt 4 _120 = (real(kind=8)) _112;
t.f90:6:5: note: stmt 5 _129 = (real(kind=8)) _128;
t.f90:6:5: note: stmt 6 _145 = (real(kind=8)) _143;
t.f90:6:5: note: stmt 7 _160 = (real(kind=8)) _158;
t.f90:6:5: note: stmt 8 _175 = (real(kind=8)) _174;
t.f90:6:5: note: stmt 9 _189 = (real(kind=8)) _188;
t.f90:6:5: note: children 0x52fa480
which is supposed to just extract from the lower half of the third vector
(I implemented that earlier). Looks like aarch64 doesn't have V2SFmode.
So what's missing in vect_create_constant_vectors is that it fails to,
for number_of_places_left_in_vector != nunits after the loop, push this
"partial vector".
Fixing that will then ICE in vectorizable_conversion. Seems the case
we run into isn't fully handled. First half of a fix:
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 18fb1168a3b..b5ac8a0e5d6 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -10908,11 +10908,15 @@ vect_create_constant_vectors (vec_info *vinfo,
slp_tree op_node)
number_of_copies = nunits * number_of_vectors / group_size;
- number_of_places_left_in_vector = nunits;
constant_p = true;
tree uniform_elt = NULL_TREE;
tree_vector_builder elts (vector_type, nunits, 1);
elts.quick_grow (nunits);
+ /* Zero-pad the last vector if necessary. */
+ number_of_places_left_in_vector
+ = nunits - nunits * number_of_vectors % group_size;
+ for (i = nunits; i > number_of_places_left_in_vector; --i)
+ elts[i-1] = build_zero_cst (TREE_TYPE (vector_type));
stmt_vec_info insert_after = NULL;
for (j = 0; j < number_of_copies; j++)
{