aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-05-05 03:18:13 +0000
committerRichard Stallman <rms@gnu.org>1993-05-05 03:18:13 +0000
commit84db222add1bde080bbcd48e53a8e8009296eb48 (patch)
tree984808e953bd465f6751f6b4d72ef2cc68e62385 /gcc
parenta394b17b086af9eced8e17c8d459ccf07e22cb6c (diff)
downloadgcc-84db222add1bde080bbcd48e53a8e8009296eb48.zip
gcc-84db222add1bde080bbcd48e53a8e8009296eb48.tar.gz
gcc-84db222add1bde080bbcd48e53a8e8009296eb48.tar.bz2
(build_array_type): The main variant of an array type
should always be an array whose element type is the main variant. From-SVN: r4328
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 7f13a3e..3953c43 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2792,6 +2792,12 @@ build_array_type (elt_type, index_type)
TREE_TYPE (t) = elt_type;
TYPE_DOMAIN (t) = index_type;
+ /* The main variant of an array type should always
+ be an array whose element type is the main variant. */
+ if (elt_type != TYPE_MAIN_VARIANT (elt_type))
+ TYPE_MAIN_VARIANT (t) = build_array_type (TYPE_MAIN_VARIANT (elt_type),
+ index_type);
+
if (index_type == 0)
return t;