OSDN Git Service

2009-01-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jan 2009 22:27:48 +0000 (22:27 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jan 2009 22:27:48 +0000 (22:27 +0000)
        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

gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vector15.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/vector-3.c [new file with mode: 0644]

index 0cccf3b..e2d97bc 100644 (file)
@@ -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
index d08a25b..b94ac1b 100644 (file)
@@ -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;
index 6a6bc13..46d2881 100644 (file)
@@ -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 (file)
index 0000000..7058bf1
--- /dev/null
@@ -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 (file)
index 0000000..3f86698
--- /dev/null
@@ -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 "" } */