]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/34911 (ICE with vectors of bool)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Mon, 5 Jan 2009 22:27:48 +0000 (22:27 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 5 Jan 2009 22:27:48 +0000 (14:27 -0800)
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

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 0cccf3b545c5ba45bf8668a277893c4e33dcc985..e2d97bc3f3b922e3c399ad3a02f6baead2884c6b 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 d08a25b96656e0730c61ced284d5f9f9aef2ef49..b94ac1b7037becc46a04e6ccdb66df1efe847dd0 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 6a6bc136b2681b441ac8fde76b61d584a330902b..46d2881e5a8fc99ea921f904217275bbd5d91015 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 "" } */