diff options
author | Dave Brolley <brolley@cygnus.com> | 1998-09-14 14:55:10 +0000 |
---|---|---|
committer | Dave Brolley <brolley@gcc.gnu.org> | 1998-09-14 10:55:10 -0400 |
commit | 20aa9a3576b0b2abd1c119dae5b0bb0527c50c51 (patch) | |
tree | ad5efebbaab715dc9f771bb9fb11d0f467ba9c57 /gcc | |
parent | e12994aba327e7f49ac3fb73405dc8449c9336ff (diff) | |
download | gcc-20aa9a3576b0b2abd1c119dae5b0bb0527c50c51.zip gcc-20aa9a3576b0b2abd1c119dae5b0bb0527c50c51.tar.gz gcc-20aa9a3576b0b2abd1c119dae5b0bb0527c50c51.tar.bz2 |
typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the domain type of the array.
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ch/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/ch/typeck.c | 16 |
2 files changed, 8 insertions, 11 deletions
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog index 20dae67..9bb6faa 100644 --- a/gcc/ch/ChangeLog +++ b/gcc/ch/ChangeLog @@ -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 diff --git a/gcc/ch/typeck.c b/gcc/ch/typeck.c index 72cff6d..3a7b464 100644 --- a/gcc/ch/typeck.c +++ b/gcc/ch/typeck.c @@ -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); |