aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-06-09 18:37:37 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-06-09 18:37:37 -0400
commit3ab1999b990d2da268828f659e47d8a5fb19afa3 (patch)
treeecfefe9fdf758f59d455a04d5c1cec44a4cbfd4a /gcc/c-common.c
parenta68d4b75929b0247ce8dfd6e63e8ef17d2549111 (diff)
downloadgcc-3ab1999b990d2da268828f659e47d8a5fb19afa3.zip
gcc-3ab1999b990d2da268828f659e47d8a5fb19afa3.tar.gz
gcc-3ab1999b990d2da268828f659e47d8a5fb19afa3.tar.bz2
(c_build_type_variant): Don't futz with main type variant of array since C...
(c_build_type_variant): Don't futz with main type variant of array since C Standard requires main type variant of array-of-const also be array-of-const. From-SVN: r14195
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 8b6d9f3..c282f16 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2514,27 +2514,8 @@ c_build_type_variant (type, constp, volatilep)
int constp, volatilep;
{
if (TREE_CODE (type) == ARRAY_TYPE)
- {
- tree real_main_variant = TYPE_MAIN_VARIANT (type);
-
- push_obstacks (TYPE_OBSTACK (real_main_variant),
- TYPE_OBSTACK (real_main_variant));
- type = build_array_type (c_build_type_variant (TREE_TYPE (type),
- constp, volatilep),
- TYPE_DOMAIN (type));
-
- /* TYPE must be on same obstack as REAL_MAIN_VARIANT. If not,
- make a copy. (TYPE might have come from the hash table and
- REAL_MAIN_VARIANT might be in some function's obstack.) */
-
- if (TYPE_OBSTACK (type) != TYPE_OBSTACK (real_main_variant))
- {
- type = copy_node (type);
- TYPE_POINTER_TO (type) = TYPE_REFERENCE_TO (type) = 0;
- }
-
- TYPE_MAIN_VARIANT (type) = real_main_variant;
- pop_obstacks ();
- }
+ return build_array_type (c_build_type_variant (TREE_TYPE (type),
+ constp, volatilep),
+ TYPE_DOMAIN (type));
return build_type_variant (type, constp, volatilep);
}