diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-12-29 17:18:22 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-12-29 12:18:22 -0500 |
commit | 5538d8a0043b1dc9abf08cbda0d27954f6931933 (patch) | |
tree | 381f3b7b0be4e21afb03ea35d41b527494af048b /gcc/tree.c | |
parent | 77f5250d6fe948fbae378415a999059f544d30b8 (diff) | |
download | gcc-5538d8a0043b1dc9abf08cbda0d27954f6931933.zip gcc-5538d8a0043b1dc9abf08cbda0d27954f6931933.tar.gz gcc-5538d8a0043b1dc9abf08cbda0d27954f6931933.tar.bz2 |
tree.c (get_set_constructor_bits): Use host_integerp and tree_low_cst.
* tree.c (get_set_constructor_bits): Use host_integerp and
tree_low_cst.
From-SVN: r38545
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -4578,26 +4578,27 @@ get_set_constructor_bits (init, buffer, bit_size) int i; tree vals; HOST_WIDE_INT domain_min - = TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init)))); + = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init))), 0); tree non_const_bits = NULL_TREE; + for (i = 0; i < bit_size; i++) buffer[i] = 0; for (vals = TREE_OPERAND (init, 1); vals != NULL_TREE; vals = TREE_CHAIN (vals)) { - if (TREE_CODE (TREE_VALUE (vals)) != INTEGER_CST + if (!host_integerp (TREE_VALUE (vals), 0) || (TREE_PURPOSE (vals) != NULL_TREE - && TREE_CODE (TREE_PURPOSE (vals)) != INTEGER_CST)) + && !host_integerp (TREE_PURPOSE (vals), 0))) non_const_bits = tree_cons (TREE_PURPOSE (vals), TREE_VALUE (vals), non_const_bits); else if (TREE_PURPOSE (vals) != NULL_TREE) { /* Set a range of bits to ones. */ HOST_WIDE_INT lo_index - = TREE_INT_CST_LOW (TREE_PURPOSE (vals)) - domain_min; + = tree_low_cst (TREE_PURPOSE (vals), 0) - domain_min; HOST_WIDE_INT hi_index - = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + = tree_low_cst (TREE_VALUE (vals), 0) - domain_min; if (lo_index < 0 || lo_index >= bit_size || hi_index < 0 || hi_index >= bit_size) @@ -4609,7 +4610,7 @@ get_set_constructor_bits (init, buffer, bit_size) { /* Set a single bit to one. */ HOST_WIDE_INT index - = TREE_INT_CST_LOW (TREE_VALUE (vals)) - domain_min; + = tree_low_cst (TREE_VALUE (vals), 0) - domain_min; if (index < 0 || index >= bit_size) { error ("invalid initializer for bit string"); |