From 2bede7299807c7eb79ef4180a0bf10ff97f301c8 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 9 Sep 1993 18:04:26 -0700 Subject: [PATCH] Add support for array with non-zero lower bounds. (Used by Chill.) From-SVN: r5300 --- gcc/c-typeck.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index db66823719c..003c302bd0d 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5338,12 +5338,17 @@ really_start_incremental_init (type) } else if (TREE_CODE (constructor_type) == ARRAY_TYPE) { - constructor_index = copy_node (integer_zero_node); constructor_range_end = 0; - constructor_unfilled_index = copy_node (integer_zero_node); if (TYPE_DOMAIN (constructor_type)) - constructor_max_index - = TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type)); + { + constructor_max_index + = TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type)); + constructor_index + = copy_node (TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type))); + } + else + constructor_index = copy_node (integer_zero_node); + constructor_unfilled_index = copy_node (constructor_index); } else { @@ -5447,12 +5452,17 @@ push_init_level (implicit) } else if (TREE_CODE (constructor_type) == ARRAY_TYPE) { - constructor_index = copy_node (integer_zero_node); constructor_range_end = 0; - constructor_unfilled_index = copy_node (integer_zero_node); if (TYPE_DOMAIN (constructor_type)) - constructor_max_index - = TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type)); + { + constructor_max_index + = TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type)); + constructor_index + = copy_node (TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type))); + } + else + constructor_index = copy_node (integer_zero_node); + constructor_unfilled_index = copy_node (constructor_index); } else { -- 2.30.2