diff options
author | Richard Henderson <rth@redhat.com> | 2000-11-19 00:36:18 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-11-19 00:36:18 -0800 |
commit | 967e627adc2763b193ba68769eb4e7da2a7b8b55 (patch) | |
tree | 968eb2abfe36e88e8e6ebef7becc08a93f529686 /gcc/tree.c | |
parent | e9284adfd06bd4f01bdc8fa4f708d3b9850e82d2 (diff) | |
download | gcc-967e627adc2763b193ba68769eb4e7da2a7b8b55.zip gcc-967e627adc2763b193ba68769eb4e7da2a7b8b55.tar.gz gcc-967e627adc2763b193ba68769eb4e7da2a7b8b55.tar.bz2 |
c-decl.c (grokdeclarator): Special case the creation of an index for a zero-length array.
* c-decl.c (grokdeclarator): Special case the creation of an
index for a zero-length array.
* tree.c (build_index_type): Revert Oct 20 change.
From-SVN: r37558
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 21 |
1 files changed, 3 insertions, 18 deletions
@@ -3676,33 +3676,18 @@ build_index_type (maxval) tree maxval; { register tree itype = make_node (INTEGER_TYPE); - int no_hash = 0; TREE_TYPE (itype) = sizetype; TYPE_PRECISION (itype) = TYPE_PRECISION (sizetype); - - /* If sizetype is unsigned and the upper bound is negative, use a - lower bound of one and an upper bound of zero. */ - if (TREE_UNSIGNED (sizetype) && TREE_CODE (maxval) == INTEGER_CST - && tree_int_cst_sgn (maxval) < 0) - { - TYPE_MIN_VALUE (itype) = size_one_node; - TYPE_MAX_VALUE (itype) = size_zero_node; - no_hash = 1; - } - else - { - TYPE_MIN_VALUE (itype) = size_zero_node; - TYPE_MAX_VALUE (itype) = convert (sizetype, maxval); - } - + TYPE_MIN_VALUE (itype) = size_zero_node; + TYPE_MAX_VALUE (itype) = convert (sizetype, maxval); TYPE_MODE (itype) = TYPE_MODE (sizetype); TYPE_SIZE (itype) = TYPE_SIZE (sizetype); TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (sizetype); TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype); TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (sizetype); - if (!no_hash && host_integerp (maxval, 1)) + if (host_integerp (maxval, 1)) return type_hash_canon (tree_low_cst (maxval, 1), itype); else return itype; |