aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-11-24 22:23:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2006-11-24 22:23:23 +0100
commit238564598bce2cc56d65382076806f3ca73af4de (patch)
tree2060c2cda335a6dde039e2b72a68b1194fc42150
parent13335ae6647410bdffb175ec9558cafcc65e0e3d (diff)
downloadgcc-238564598bce2cc56d65382076806f3ca73af4de.zip
gcc-238564598bce2cc56d65382076806f3ca73af4de.tar.gz
gcc-238564598bce2cc56d65382076806f3ca73af4de.tar.bz2
re PR c/29736 (ICE on duplicate vector attribute)
PR c/29736 * c-common.c (handle_vector_size_attribute): Disallow VECTOR_TYPE or UNION_TYPE inner types. * gcc.dg/pr29736.c: New test. From-SVN: r119165
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-common.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr29736.c13
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12c14de..b92949e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-11-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/29736
+ * c-common.c (handle_vector_size_attribute): Disallow VECTOR_TYPE
+ or UNION_TYPE inner types.
+
2006-11-24 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/29964
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 8e4cbff..d576955 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5450,6 +5450,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
orig_mode = TYPE_MODE (type);
if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == VECTOR_TYPE
|| (!SCALAR_FLOAT_MODE_P (orig_mode)
&& GET_MODE_CLASS (orig_mode) != MODE_INT)
|| !host_integerp (TYPE_SIZE_UNIT (type), 1))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 49a333b..473307a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/29736
+ * gcc.dg/pr29736.c: New test.
+
2006-11-24 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/29964
diff --git a/gcc/testsuite/gcc.dg/pr29736.c b/gcc/testsuite/gcc.dg/pr29736.c
new file mode 100644
index 0000000..54eb9aa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr29736.c
@@ -0,0 +1,13 @@
+/* PR c/29736 */
+
+int __attribute__ ((vector_size (8), vector_size (8))) v; /* { dg-error "invalid vector type" } */
+
+extern int __attribute__ ((vector_size (8))) w;
+int __attribute__ ((vector_size (8))) w;
+
+void
+foo ()
+{
+ v = v + v;
+ w = w + w;
+}