Add support for array with non-zero lower bounds. (Used by Chill.)
authorPer Bothner <bothner@gcc.gnu.org>
Fri, 10 Sep 1993 01:04:26 +0000 (18:04 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Fri, 10 Sep 1993 01:04:26 +0000 (18:04 -0700)
From-SVN: r5300

gcc/c-typeck.c

index db66823719c317488a486fc9e6a47fd4cd391bb7..003c302bd0d878317ab58eeb28eec6d90edbc61f 100644 (file)
@@ -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
     {