summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-05 22:27:48 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-05 22:27:48 +0000
commit7ec31215480d16e4d36e29366c26ccb174249d33 (patch)
tree71687dd989b69df6ba933cc02fd86a6983bf67fe /gcc
parentc960ca50b931840ef8c8dc3a2838c4cb00c8a36e (diff)
downloadgcc-7ec31215480d16e4d36e29366c26ccb174249d33.tar.gz
2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c/34911 * c-common.c (handle_vector_size_attribute): Also reject BOOLEAN_TYPE types. 2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com> PR c/34911 * gcc.dg/vector-3.c: New testcase. * g++.dg/ext/vector15.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143099 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c3
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/ext/vector15.C5
-rw-r--r--gcc/testsuite/gcc.dg/vector-3.c5
5 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0cccf3b545c..e2d97bc3f3b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c/34911
+ * c-common.c (handle_vector_size_attribute): Also reject BOOLEAN_TYPE types.
+
2009-01-05 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/38492
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d08a25b9665..b94ac1b7037 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -6544,7 +6544,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
|| (!SCALAR_FLOAT_MODE_P (orig_mode)
&& GET_MODE_CLASS (orig_mode) != MODE_INT
&& !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode))
- || !host_integerp (TYPE_SIZE_UNIT (type), 1))
+ || !host_integerp (TYPE_SIZE_UNIT (type), 1)
+ || TREE_CODE (type) == BOOLEAN_TYPE)
{
error ("invalid vector type for attribute %qE", name);
return NULL_TREE;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6a6bc136b26..46d2881e5a8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c/34911
+ * gcc.dg/vector-3.c: New testcase.
+ * g++.dg/ext/vector15.C: New test.
+
2009-01-05 Harsha Jagasia <harsha.jagasia@amd.com>
PR tree-optimization/38510
diff --git a/gcc/testsuite/g++.dg/ext/vector15.C b/gcc/testsuite/g++.dg/ext/vector15.C
new file mode 100644
index 00000000000..7058bf1b8c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vector15.C
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+/* Check that we error out when using vector_size on the bool type. */
+
+__attribute__((vector_size(16) )) bool a; /* { dg-error "" } */
diff --git a/gcc/testsuite/gcc.dg/vector-3.c b/gcc/testsuite/gcc.dg/vector-3.c
new file mode 100644
index 00000000000..3f86698b83f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vector-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+/* Check that we error out when using vector_size on the bool type. */
+
+__attribute__((vector_size(16) )) _Bool a; /* { dg-error "" } */