diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 17:03:12 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-22 17:03:12 +0000 |
commit | 2cb0e5d93bd600a6ed3781755c8080f8ae2db74c (patch) | |
tree | bdf1a2c50a6ec8b32870c8f61c89d45760a612c7 /gcc/c-common.c | |
parent | ad1375863fa7cb559a6adcf93d98b49a7a676944 (diff) | |
download | gcc-2cb0e5d93bd600a6ed3781755c8080f8ae2db74c.tar.gz |
PR c++/34914
* c-common.c (handle_vector_size_attribute): Only allow
integral, scalar float and fixed point types. Handle OFFSET_TYPE
the same way as pointer, array etc. types.
* tree.c (reconstruct_complex_type): Handle OFFSET_TYPE.
* g++.dg/ext/vector10.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 4e5d24c6fd2..1ba5c785c79 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -6031,15 +6031,16 @@ handle_vector_size_attribute (tree *node, tree name, tree args, while (POINTER_TYPE_P (type) || TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE - || TREE_CODE (type) == ARRAY_TYPE) + || TREE_CODE (type) == ARRAY_TYPE + || TREE_CODE (type) == OFFSET_TYPE) type = TREE_TYPE (type); /* Get the mode of the type being modified. */ orig_mode = TYPE_MODE (type); - if (TREE_CODE (type) == RECORD_TYPE - || TREE_CODE (type) == UNION_TYPE - || TREE_CODE (type) == VECTOR_TYPE + if ((!INTEGRAL_TYPE_P (type) + && !SCALAR_FLOAT_TYPE_P (type) + && !FIXED_POINT_TYPE_P (type)) || (!SCALAR_FLOAT_MODE_P (orig_mode) && GET_MODE_CLASS (orig_mode) != MODE_INT && !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode)) |