diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-26 06:58:01 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-26 06:58:01 +0000 |
commit | d5b04d83f872703da4a8ee4253a68ad4a0596e15 (patch) | |
tree | 5c5f1a8ad11f67954275c0e6979b919433ead64c /gcc/attribs.c | |
parent | 019f2e94872f792282611bc8106c2fa4bb04f4d4 (diff) | |
download | ppe42-gcc-d5b04d83f872703da4a8ee4253a68ad4a0596e15.tar.gz ppe42-gcc-d5b04d83f872703da4a8ee4253a68ad4a0596e15.zip |
2002-02-26 Aldy Hernandez <aldyh@redhat.com>
* dwarf2out.c (modified_type_die): Do not call type_main_variant
for vectors.
(gen_type_die): Same.
* attribs.c (handle_vector_size_attribute): Set debug information.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50048 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index b915c880716..d046a6242ba 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -1307,12 +1307,33 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs) error ("no vector mode with the size and type specified could be found"); else { + tree index, array, rt; + new_type = type_for_mode (new_mode, TREE_UNSIGNED (type)); + if (!new_type) - error ("no vector mode with the size and type specified could be found"); - else - /* Build back pointers if needed. */ - *node = vector_size_helper (*node, new_type); + { + error ("no vector mode with the size and type specified could be found"); + return NULL_TREE; + } + + new_type = build_type_copy (new_type); + + /* Set the debug information here, because this is the only + place where we know the underlying type for a vector made + with vector_size. For debugging purposes we pretend a vector + is an array within a structure. */ + index = build_int_2 (TYPE_VECTOR_SUBPARTS (new_type) - 1, 0); + array = build_array_type (type, build_index_type (index)); + rt = make_node (RECORD_TYPE); + + TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array); + DECL_CONTEXT (TYPE_FIELDS (rt)) = rt; + layout_type (rt); + TYPE_DEBUG_REPRESENTATION_TYPE (new_type) = rt; + + /* Build back pointers if needed. */ + *node = vector_size_helper (*node, new_type); } return NULL_TREE; |