From: Per Bothner Date: Fri, 10 Sep 1993 01:04:26 +0000 (-0700) Subject: Add support for array with non-zero lower bounds. (Used by Chill.) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2bede7299807c7eb79ef4180a0bf10ff97f301c8;p=gcc.git Add support for array with non-zero lower bounds. (Used by Chill.) From-SVN: r5300 --- 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 {