@@ -4245,10 +4245,22 @@ type_valid_for_vector_size (tree type, tree atname, tree args,
if (nunits & (nunits - 1))
{
if (error_p)
- error ("number of components of the vector not a power of two");
+ error ("number of vector components %wu not a power of two", nunits);
else
warning (OPT_Wattributes,
- "number of components of the vector not a power of two");
+ "number of vector components %wu not a power of two", nunits);
+ return NULL_TREE;
+ }
+
+ if (nunits >= (unsigned HOST_WIDE_INT)INT_MAX)
+ {
+ if (error_p)
+ error ("number of vector components %wu exceeds %d",
+ nunits, INT_MAX - 1);
+ else
+ warning (OPT_Wattributes,
+ "number of vector components %wu exceeds %d",
+ nunits, INT_MAX - 1);
return NULL_TREE;
}
@@ -22,14 +22,6 @@ DEFVEC (extern, 30);
#if __SIZEOF_SIZE_T__ > 4
-DEFVEC (extern, 31);
-DEFVEC (extern, 32);
-DEFVEC (extern, 33);
-DEFVEC (extern, 34);
-DEFVEC (extern, 60);
-DEFVEC (extern, 61);
-DEFVEC (extern, 62);
-
VEC (POW2 (63)) char v63; /* { dg-error "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "LP64" { target lp64 } } */
#else
@@ -49,14 +41,6 @@ void test_local_scope (void)
#if __SIZEOF_SIZE_T__ > 4
- DEFVEC (auto, 31);
- DEFVEC (auto, 32);
- DEFVEC (auto, 33);
- DEFVEC (auto, 34);
- DEFVEC (auto, 60);
- DEFVEC (auto, 61);
- DEFVEC (auto, 62);
-
VEC (POW2 (63)) char v63; /* { dg-error "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "LP64" { target lp64 } } */
#else
new file mode 100644
@@ -0,0 +1,35 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O -g" } */
+
+typedef int __attribute__((vector_size(
+ ((((((((((((((((((((((((((((((8 * sizeof(short)) * sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)) *
+ sizeof(short)))) V; /* { dg-error "number of vector components" } */
+void k() { V w = { 0 }; }