aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2009-01-05 22:27:48 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2009-01-05 14:27:48 -0800
commite4e5261f2007b11c1136df16fee633caeeb10154 (patch)
tree71687dd989b69df6ba933cc02fd86a6983bf67fe /gcc
parent381009fe75fca1b2c0440e101fa46a2decdbb0fa (diff)
downloadgcc-e4e5261f2007b11c1136df16fee633caeeb10154.zip
gcc-e4e5261f2007b11c1136df16fee633caeeb10154.tar.gz
gcc-e4e5261f2007b11c1136df16fee633caeeb10154.tar.bz2
re PR c/34911 (ICE with vectors of bool)
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. From-SVN: r143099
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 0cccf3b..e2d97bc 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 d08a25b..b94ac1b 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 6a6bc13..46d2881 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 0000000..7058bf1
--- /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 0000000..3f86698
--- /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 "" } */