Commit 757bbef8 by Steven Bosscher

cselib.c (struct cselib_val_struct): Make val_rtx its own field, remove the…

cselib.c (struct cselib_val_struct): Make val_rtx its own field, remove the union that contained it.

	* cselib.c (struct cselib_val_struct): Make val_rtx its
	own field, remove the union that contained it.
	* cselib.c: Update accordingly where necessary.

From-SVN: r119994
parent a7582f7c
2006-12-17 Steven Bosscher <steven@gcc.gnu.org> 2006-12-17 Steven Bosscher <steven@gcc.gnu.org>
* cselib.c (struct cselib_val_struct): Make val_rtx its
own field, remove the union that contained it.
* cselib.c: Update accordingly where necessary.
2006-12-17 Steven Bosscher <steven@gcc.gnu.org>
* cse.c (have_eh_succ_edges): New function. * cse.c (have_eh_succ_edges): New function.
(cse_insn): Don't remove dead EH edges here (cse_insn): Don't remove dead EH edges here
(cse_extended_basic_block): Do it here. (cse_extended_basic_block): Do it here.
......
...@@ -237,7 +237,7 @@ entry_and_rtx_equal_p (const void *entry, const void *x_arg) ...@@ -237,7 +237,7 @@ entry_and_rtx_equal_p (const void *entry, const void *x_arg)
gcc_assert (GET_CODE (x) != CONST_INT gcc_assert (GET_CODE (x) != CONST_INT
&& (mode != VOIDmode || GET_CODE (x) != CONST_DOUBLE)); && (mode != VOIDmode || GET_CODE (x) != CONST_DOUBLE));
if (mode != GET_MODE (v->u.val_rtx)) if (mode != GET_MODE (v->val_rtx))
return 0; return 0;
/* Unwrap X if necessary. */ /* Unwrap X if necessary. */
...@@ -331,7 +331,7 @@ discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED) ...@@ -331,7 +331,7 @@ discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED)
if (v->locs == 0) if (v->locs == 0)
{ {
CSELIB_VAL_PTR (v->u.val_rtx) = NULL; CSELIB_VAL_PTR (v->val_rtx) = NULL;
htab_clear_slot (cselib_hash_table, x); htab_clear_slot (cselib_hash_table, x);
unchain_one_value (v); unchain_one_value (v);
n_useless_values--; n_useless_values--;
...@@ -387,7 +387,7 @@ cselib_reg_set_mode (rtx x) ...@@ -387,7 +387,7 @@ cselib_reg_set_mode (rtx x)
|| REG_VALUES (REGNO (x))->elt == NULL) || REG_VALUES (REGNO (x))->elt == NULL)
return VOIDmode; return VOIDmode;
return GET_MODE (REG_VALUES (REGNO (x))->elt->u.val_rtx); return GET_MODE (REG_VALUES (REGNO (x))->elt->val_rtx);
} }
/* Return nonzero if we can prove that X and Y contain the same value, taking /* Return nonzero if we can prove that X and Y contain the same value, taking
...@@ -405,7 +405,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y) ...@@ -405,7 +405,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
cselib_val *e = cselib_lookup (x, GET_MODE (x), 0); cselib_val *e = cselib_lookup (x, GET_MODE (x), 0);
if (e) if (e)
x = e->u.val_rtx; x = e->val_rtx;
} }
if (REG_P (y) || MEM_P (y)) if (REG_P (y) || MEM_P (y))
...@@ -413,7 +413,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y) ...@@ -413,7 +413,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
cselib_val *e = cselib_lookup (y, GET_MODE (y), 0); cselib_val *e = cselib_lookup (y, GET_MODE (y), 0);
if (e) if (e)
y = e->u.val_rtx; y = e->val_rtx;
} }
if (x == y) if (x == y)
...@@ -748,11 +748,11 @@ new_cselib_val (unsigned int value, enum machine_mode mode) ...@@ -748,11 +748,11 @@ new_cselib_val (unsigned int value, enum machine_mode mode)
precisely when we can have VALUE RTXen (when cselib is active) precisely when we can have VALUE RTXen (when cselib is active)
so we don't need to put them in garbage collected memory. so we don't need to put them in garbage collected memory.
??? Why should a VALUE be an RTX in the first place? */ ??? Why should a VALUE be an RTX in the first place? */
e->u.val_rtx = pool_alloc (value_pool); e->val_rtx = pool_alloc (value_pool);
memset (e->u.val_rtx, 0, RTX_HDR_SIZE); memset (e->val_rtx, 0, RTX_HDR_SIZE);
PUT_CODE (e->u.val_rtx, VALUE); PUT_CODE (e->val_rtx, VALUE);
PUT_MODE (e->u.val_rtx, mode); PUT_MODE (e->val_rtx, mode);
CSELIB_VAL_PTR (e->u.val_rtx) = e; CSELIB_VAL_PTR (e->val_rtx) = e;
e->addr_list = 0; e->addr_list = 0;
e->locs = 0; e->locs = 0;
e->next_containing_mem = 0; e->next_containing_mem = 0;
...@@ -777,7 +777,7 @@ add_mem_for_addr (cselib_val *addr_elt, cselib_val *mem_elt, rtx x) ...@@ -777,7 +777,7 @@ add_mem_for_addr (cselib_val *addr_elt, cselib_val *mem_elt, rtx x)
addr_elt->addr_list = new_elt_list (addr_elt->addr_list, mem_elt); addr_elt->addr_list = new_elt_list (addr_elt->addr_list, mem_elt);
mem_elt->locs mem_elt->locs
= new_elt_loc_list (mem_elt->locs, = new_elt_loc_list (mem_elt->locs,
replace_equiv_address_nv (x, addr_elt->u.val_rtx)); replace_equiv_address_nv (x, addr_elt->val_rtx));
if (mem_elt->next_containing_mem == NULL) if (mem_elt->next_containing_mem == NULL)
{ {
mem_elt->next_containing_mem = first_containing_mem; mem_elt->next_containing_mem = first_containing_mem;
...@@ -809,7 +809,7 @@ cselib_lookup_mem (rtx x, int create) ...@@ -809,7 +809,7 @@ cselib_lookup_mem (rtx x, int create)
/* Find a value that describes a value of our mode at that address. */ /* Find a value that describes a value of our mode at that address. */
for (l = addr->addr_list; l; l = l->next) for (l = addr->addr_list; l; l = l->next)
if (GET_MODE (l->elt->u.val_rtx) == mode) if (GET_MODE (l->elt->val_rtx) == mode)
return l->elt; return l->elt;
if (! create) if (! create)
...@@ -846,8 +846,8 @@ cselib_subst_to_values (rtx x) ...@@ -846,8 +846,8 @@ cselib_subst_to_values (rtx x)
if (l && l->elt == NULL) if (l && l->elt == NULL)
l = l->next; l = l->next;
for (; l; l = l->next) for (; l; l = l->next)
if (GET_MODE (l->elt->u.val_rtx) == GET_MODE (x)) if (GET_MODE (l->elt->val_rtx) == GET_MODE (x))
return l->elt->u.val_rtx; return l->elt->val_rtx;
gcc_unreachable (); gcc_unreachable ();
...@@ -859,7 +859,7 @@ cselib_subst_to_values (rtx x) ...@@ -859,7 +859,7 @@ cselib_subst_to_values (rtx x)
match any other. */ match any other. */
e = new_cselib_val (++next_unknown_value, GET_MODE (x)); e = new_cselib_val (++next_unknown_value, GET_MODE (x));
} }
return e->u.val_rtx; return e->val_rtx;
case CONST_DOUBLE: case CONST_DOUBLE:
case CONST_VECTOR: case CONST_VECTOR:
...@@ -873,7 +873,7 @@ cselib_subst_to_values (rtx x) ...@@ -873,7 +873,7 @@ cselib_subst_to_values (rtx x)
case POST_MODIFY: case POST_MODIFY:
case PRE_MODIFY: case PRE_MODIFY:
e = new_cselib_val (++next_unknown_value, GET_MODE (x)); e = new_cselib_val (++next_unknown_value, GET_MODE (x));
return e->u.val_rtx; return e->val_rtx;
default: default:
break; break;
...@@ -943,7 +943,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create) ...@@ -943,7 +943,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create)
if (l && l->elt == NULL) if (l && l->elt == NULL)
l = l->next; l = l->next;
for (; l; l = l->next) for (; l; l = l->next)
if (mode == GET_MODE (l->elt->u.val_rtx)) if (mode == GET_MODE (l->elt->val_rtx))
return l->elt; return l->elt;
if (! create) if (! create)
...@@ -1050,7 +1050,7 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode) ...@@ -1050,7 +1050,7 @@ cselib_invalidate_regno (unsigned int regno, enum machine_mode mode)
unsigned int this_last = i; unsigned int this_last = i;
if (i < FIRST_PSEUDO_REGISTER && v != NULL) if (i < FIRST_PSEUDO_REGISTER && v != NULL)
this_last += hard_regno_nregs[i][GET_MODE (v->u.val_rtx)] - 1; this_last += hard_regno_nregs[i][GET_MODE (v->val_rtx)] - 1;
if (this_last < regno || v == NULL) if (this_last < regno || v == NULL)
{ {
...@@ -1422,7 +1422,7 @@ cselib_process_insn (rtx insn) ...@@ -1422,7 +1422,7 @@ cselib_process_insn (rtx insn)
if (call_used_regs[i] if (call_used_regs[i]
|| (REG_VALUES (i) && REG_VALUES (i)->elt || (REG_VALUES (i) && REG_VALUES (i)->elt
&& HARD_REGNO_CALL_PART_CLOBBERED (i, && HARD_REGNO_CALL_PART_CLOBBERED (i,
GET_MODE (REG_VALUES (i)->elt->u.val_rtx)))) GET_MODE (REG_VALUES (i)->elt->val_rtx))))
cselib_invalidate_regno (i, reg_raw_mode[i]); cselib_invalidate_regno (i, reg_raw_mode[i]);
if (! CONST_OR_PURE_CALL_P (insn)) if (! CONST_OR_PURE_CALL_P (insn))
......
...@@ -24,17 +24,14 @@ typedef struct cselib_val_struct GTY(()) ...@@ -24,17 +24,14 @@ typedef struct cselib_val_struct GTY(())
{ {
/* The hash value. */ /* The hash value. */
unsigned int value; unsigned int value;
union cselib_val_u
{
/* A VALUE rtx that points back to this structure. */ /* A VALUE rtx that points back to this structure. */
rtx GTY ((tag ("1"))) val_rtx; rtx val_rtx;
/* Used to keep a list of free cselib_val structures. */
struct cselib_val_struct * GTY ((skip)) next_free;
} GTY ((desc ("1"))) u;
/* All rtl expressions that hold this value at the current time during a /* All rtl expressions that hold this value at the current time during a
scan. */ scan. */
struct elt_loc_list *locs; struct elt_loc_list *locs;
/* If this value is used as an address, points to a list of values that /* If this value is used as an address, points to a list of values that
use it as an address in a MEM. */ use it as an address in a MEM. */
struct elt_list *addr_list; struct elt_list *addr_list;
......
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