aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2004-05-01 00:08:17 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-05-01 00:08:17 +0000
commit5c5214a92e6291e8f811f24cf838a8ab40edbbf0 (patch)
treef8771ff05ff7ef4e27ee7846ed2bc198dd9cdba9 /gcc/expr.c
parent672149847fcde1b055ddbcfff7849e3a6a4043aa (diff)
downloadgcc-5c5214a92e6291e8f811f24cf838a8ab40edbbf0.zip
gcc-5c5214a92e6291e8f811f24cf838a8ab40edbbf0.tar.gz
gcc-5c5214a92e6291e8f811f24cf838a8ab40edbbf0.tar.bz2
tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK and adjust definition accordingly.
* 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. From-SVN: r81373
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 2afe44d..9f246dc 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)))