Commit 5538d8a0 by Richard Kenner Committed by Richard Kenner

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
parent 77f5250d
2000-12-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2000-12-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree.c (get_set_constructor_bits): Use host_integerp and
tree_low_cst.
* local-alloc.c (update_equiv_regs): Don't use copy_rtx on PATTERN. * local-alloc.c (update_equiv_regs): Don't use copy_rtx on PATTERN.
* toplev.c (main): Call xmalloc_set_program_name. * toplev.c (main): Call xmalloc_set_program_name.
......
...@@ -4578,26 +4578,27 @@ get_set_constructor_bits (init, buffer, bit_size) ...@@ -4578,26 +4578,27 @@ get_set_constructor_bits (init, buffer, bit_size)
int i; int i;
tree vals; tree vals;
HOST_WIDE_INT domain_min 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; tree non_const_bits = NULL_TREE;
for (i = 0; i < bit_size; i++) for (i = 0; i < bit_size; i++)
buffer[i] = 0; buffer[i] = 0;
for (vals = TREE_OPERAND (init, 1); for (vals = TREE_OPERAND (init, 1);
vals != NULL_TREE; vals = TREE_CHAIN (vals)) 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_PURPOSE (vals) != NULL_TREE
&& TREE_CODE (TREE_PURPOSE (vals)) != INTEGER_CST)) && !host_integerp (TREE_PURPOSE (vals), 0)))
non_const_bits non_const_bits
= tree_cons (TREE_PURPOSE (vals), TREE_VALUE (vals), non_const_bits); = tree_cons (TREE_PURPOSE (vals), TREE_VALUE (vals), non_const_bits);
else if (TREE_PURPOSE (vals) != NULL_TREE) else if (TREE_PURPOSE (vals) != NULL_TREE)
{ {
/* Set a range of bits to ones. */ /* Set a range of bits to ones. */
HOST_WIDE_INT lo_index 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 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 if (lo_index < 0 || lo_index >= bit_size
|| hi_index < 0 || hi_index >= bit_size) || hi_index < 0 || hi_index >= bit_size)
...@@ -4609,7 +4610,7 @@ get_set_constructor_bits (init, buffer, bit_size) ...@@ -4609,7 +4610,7 @@ get_set_constructor_bits (init, buffer, bit_size)
{ {
/* Set a single bit to one. */ /* Set a single bit to one. */
HOST_WIDE_INT index 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) if (index < 0 || index >= bit_size)
{ {
error ("invalid initializer for bit string"); error ("invalid initializer for bit string");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment