@@ -15084,6 +15084,12 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
{
DECL_ORIGINAL_TYPE (r) = NULL_TREE;
set_underlying_type (r);
+
+ /* common_handle_aligned_attribute doesn't apply the alignment
+ to DECL_ORIGINAL_TYPE. */
+ if (TYPE_USER_ALIGN (TREE_TYPE (t)))
+ TREE_TYPE (r) = build_aligned_type (TREE_TYPE (r),
+ TYPE_ALIGN (TREE_TYPE (t)));
}
layout_decl (r, 0);
new file mode 100644
@@ -0,0 +1,16 @@
+// PR c++/65211
+// { dg-final { scan-assembler-not "movdqa" } }
+
+typedef unsigned v4ui __attribute__ ((vector_size(16), aligned (16)));
+
+template<int I>
+static v4ui t1(unsigned *dest_data)
+{
+ typedef unsigned v4ui_1 __attribute__ ((vector_size (16), aligned (4)));
+ return ((const v4ui_1*)dest_data)[0];
+}
+
+v4ui f(unsigned int *array)
+{
+ return t1<1>(array+7);
+}