summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-01 00:08:17 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-01 00:08:17 +0000
commit49be8259f83c7ef43fccb767df333d8870fb4d34 (patch)
treef8771ff05ff7ef4e27ee7846ed2bc198dd9cdba9 /gcc/expr.c
parent316e17aef38913850104bf635ecbda834f7584ea (diff)
downloadgcc-49be8259f83c7ef43fccb767df333d8870fb4d34.tar.gz
* tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK
and adjust definition accordingly. (TYPE_DOMAIN): Allow only SET_TYPE and ARRAY_TYPE. (TYPE_DEBUG_REPRESENTATION_TYPE): Allow only VECTOR_TYPE. * expr.c (store_constructor): Do not access TYPE_DOMAIN of a VECTOR_TYPE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81373 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 2afe44db287..9f246dcf6a3 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4723,7 +4723,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
tree elt;
int i;
int need_to_clear;
- tree domain = TYPE_DOMAIN (type);
+ tree domain;
tree elttype = TREE_TYPE (type);
int const_bounds_p;
HOST_WIDE_INT minelt = 0;
@@ -4733,13 +4733,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
int elt_size = 0;
unsigned n_elts = 0;
- /* Vectors are like arrays, but the domain is stored via an array
- type indirectly. */
- if (TREE_CODE (type) == VECTOR_TYPE)
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ domain = TYPE_DOMAIN (type);
+ else
+ /* Vectors do not have domains; look up the domain of
+ the array embedded in the debug representation type.
+ FIXME Would probably be more efficient to treat vectors
+ separately from arrays. */
{
- /* Note that although TYPE_DEBUG_REPRESENTATION_TYPE uses
- the same field as TYPE_DOMAIN, we are not guaranteed that
- it always will. */
domain = TYPE_DEBUG_REPRESENTATION_TYPE (type);
domain = TYPE_DOMAIN (TREE_TYPE (TYPE_FIELDS (domain)));
if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))