}
/* Look for the closing `)'. */
parens.require_close (parser);
- return cp_build_vec_convert (expression, type_location, type,
- tf_warning_or_error);
+ postfix_expression
+ = cp_build_vec_convert (expression, type_location, type,
+ tf_warning_or_error);
+ break;
}
case RID_BUILTIN_BIT_CAST:
expression = cp_parser_assignment_expression (parser);
/* Look for the closing `)'. */
parens.require_close (parser);
- return cp_build_bit_cast (type_location, type, expression,
- tf_warning_or_error);
+ postfix_expression
+ = cp_build_bit_cast (type_location, type, expression,
+ tf_warning_or_error);
+ break;
}
default:
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int v4si __attribute__((vector_size (4 * sizeof (int))));
+typedef double v4df __attribute__((vector_size (4 * sizeof (double))));
+double
+foo (void)
+{
+ v4si a = { 1, 2, 3, 4 };
+ return __builtin_convertvector (a, v4df)[1];
+}
--- /dev/null
+// { dg-do compile }
+
+struct S { short a, b; };
+struct T { float a[4]; };
+struct U { int b[4]; };
+
+#if __SIZEOF_FLOAT__ == __SIZEOF_INT__
+int
+f1 (T &x)
+{
+ return __builtin_bit_cast (U, x).b[1];
+}
+
+float
+f2 (int (&x)[4])
+{
+ return __builtin_bit_cast (T, x).a[2];
+}
+#endif