typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the domain type of the...
authorDave Brolley <brolley@cygnus.com>
Mon, 14 Sep 1998 14:55:10 +0000 (14:55 +0000)
committerDave Brolley <brolley@gcc.gnu.org>
Mon, 14 Sep 1998 14:55:10 +0000 (10:55 -0400)
Mon Sep 14 16:46:36 1998  Dave Brolley  <brolley@cygnus.com>
* typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the
domain type of the array.

From-SVN: r22420

gcc/ch/ChangeLog
gcc/ch/typeck.c

index 20dae6740410bde64be1bc40466af5053defd0ee..9bb6faad3a7915dff16e822155ae3dc3787cbe0d 100644 (file)
@@ -1,5 +1,8 @@
 Mon Sep 14 16:46:36 1998  Dave Brolley  <brolley@cygnus.com>
 
+       * typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the
+       domain type of the array.
+
        * expr.c (build_chill_function_call): Remove redundant call to
        chill_convert_to_assignment
 
index 72cff6daa353eabebb04810937ea2b5a41c44a8d..3a7b4642bd56f939e40048b913997606f3e7fbd2 100644 (file)
@@ -237,18 +237,12 @@ build_chill_slice (array, min_value, length)
   if (TREE_CODE (array_type) == ARRAY_TYPE)
     {
       tree domain_type = TYPE_DOMAIN (array_type);
-      tree index_domain
-       = TREE_CODE (length) != INTEGER_CST || integer_zerop (length)
-       ? sizetype
-       : domain_type;
-      tree domain_min = convert (index_domain, TYPE_MIN_VALUE (domain_type));
-      tree domain_max = fold (build (PLUS_EXPR, index_domain,
+      tree domain_min = TYPE_MIN_VALUE (domain_type);
+      tree domain_max = fold (build (PLUS_EXPR, domain_type,
                                     domain_min,
-                                    convert (index_domain,
-                                             size_binop (MINUS_EXPR,
-                                                         length,
-                                                         integer_one_node))));
-      tree index_type = build_chill_range_type (domain_type,
+                                    size_binop (MINUS_EXPR,
+                                                length, integer_one_node)));
+      tree index_type = build_chill_range_type (TYPE_DOMAIN (array_type),
                                                domain_min,
                                                domain_max);