--- /dev/null
+// { dg-lto-do assemble }
+// { dg-lto-options { { -O -flto } } }
+
+template <typename scalar_t, unsigned length>
+struct builtin_simd
+{
+ using type [[gnu::vector_size(sizeof(scalar_t) * length)]] = scalar_t;
+};
+
+struct simd_traits
+{
+ using scalar_type = int;
+
+ template <typename new_scalar_type>
+ using rebind = typename builtin_simd<new_scalar_type, 1>::type;
+};
+
+template <typename simd_t>
+constexpr simd_t fill(typename simd_traits::scalar_type const scalar)
+{
+ return simd_t{scalar};
+}
+
+class Test
+{
+ using score_type = typename builtin_simd<int, 1>::type;
+ score_type data[1]{fill<score_type>(8)};
+};
+
+struct TestFactoryBase
+{
+ virtual Test *CreateTest() = 0;
+};
+
+template <class TestClass>
+struct TestFactoryImpl : public TestFactoryBase
+{
+ Test *CreateTest() override { return new TestClass; }
+};
+
+void MakeAndRegisterTestInfo(TestFactoryBase *factory);
+
+int main() {
+ MakeAndRegisterTestInfo(new TestFactoryImpl<Test>);
+}
case INTEGER_CST:
case REAL_CST:
case FIXED_CST:
- case VECTOR_CST:
case STRING_CST:
case BLOCK:
case PLACEHOLDER_EXPR:
WALK_SUBTREE_TAIL (TREE_VEC_ELT (*tp, 0));
}
+ case VECTOR_CST:
+ {
+ unsigned len = vector_cst_encoded_nelts (*tp);
+ if (len == 0)
+ break;
+ /* Walk all elements but the first. */
+ while (--len)
+ WALK_SUBTREE (VECTOR_CST_ENCODED_ELT (*tp, len));
+ /* Now walk the first one as a tail call. */
+ WALK_SUBTREE_TAIL (VECTOR_CST_ENCODED_ELT (*tp, 0));
+ }
+
case COMPLEX_CST:
WALK_SUBTREE (TREE_REALPART (*tp));
WALK_SUBTREE_TAIL (TREE_IMAGPART (*tp));