From: Andrew Pinski Date: Mon, 5 Jan 2009 22:27:48 +0000 (+0000) Subject: re PR c/34911 (ICE with vectors of bool) X-Git-Tag: releases/gcc-4.4.0~1021 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4e5261f2007b11c1136df16fee633caeeb10154;p=thirdparty%2Fgcc.git re PR c/34911 (ICE with vectors of bool) 2009-01-05 Andrew Pinski PR c/34911 * c-common.c (handle_vector_size_attribute): Also reject BOOLEAN_TYPE types. 2009-01-05 Andrew Pinski PR c/34911 * gcc.dg/vector-3.c: New testcase. * g++.dg/ext/vector15.C: New test. From-SVN: r143099 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cccf3b545c5..e2d97bc3f3b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-01-05 Andrew Pinski + + PR c/34911 + * c-common.c (handle_vector_size_attribute): Also reject BOOLEAN_TYPE types. + 2009-01-05 Sebastian Pop PR tree-optimization/38492 diff --git a/gcc/c-common.c b/gcc/c-common.c index d08a25b96656..b94ac1b7037b 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 6a6bc136b268..46d2881e5a8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-01-05 Andrew Pinski + + PR c/34911 + * gcc.dg/vector-3.c: New testcase. + * g++.dg/ext/vector15.C: New test. + 2009-01-05 Harsha Jagasia 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 000000000000..7058bf1b8c04 --- /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 000000000000..3f86698b83fb --- /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 "" } */