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
This commit is contained in:
Jakub Jelinek 2006-11-24 22:23:23 +01:00 committed by Jakub Jelinek
parent 13335ae664
commit 238564598b
4 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -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;
}