/* Compute register class preferences for pseudo-registers.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996
- 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
return 1;
}
-struct tree_opt_pass pass_regclass_init =
+struct rtl_opt_pass pass_regclass_init =
{
+ {
+ RTL_PASS,
"regclass", /* name */
NULL, /* gate */
regclass_init, /* execute */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- 'k' /* letter */
+ 0 /* todo_flags_finish */
+ }
};
record_address_regs (GET_MODE (recog_data.operand[i]),
XEXP (recog_data.operand[i], 0),
0, MEM, SCRATCH, frequency * 2);
- else if (constraints[i][0] == 'p'
- || EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], constraints[i]))
+ else if (recog_data.alternative_enabled_p[0]
+ && (constraints[i][0] == 'p'
+ || EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], constraints[i])))
record_address_regs (VOIDmode, recog_data.operand[i], 0, ADDRESS,
SCRATCH, frequency * 2);
}
requires secondary reloads, disallow its class from
being used in such addresses. */
- if ((secondary_reload_class (1, base_class, m, r)
+ if ((secondary_reload_class (0, base_class, m, r)
|| secondary_reload_class (1, base_class, m, r))
&& ! auto_inc_dec_reg_p (r, m))
forbidden_inc_dec_class[i] = 1;
init_recog ();
- reg_renumber = xmalloc (max_regno * sizeof (short));
+ reg_renumber = XNEWVEC (short, max_regno);
reg_pref = XCNEWVEC (struct reg_pref, max_regno);
memset (reg_renumber, -1, max_regno * sizeof (short));
[(int) base_reg_class (VOIDmode, ADDRESS, SCRATCH)];
break;
- case 'm': case 'o': case 'V':
+ case TARGET_MEM_CONSTRAINT: case 'o': case 'V':
/* It doesn't seem worth distinguishing between offsettable
and non-offsettable addresses here. */
allows_mem[i] = 1;
if (alt_fail)
continue;
+ if (!recog_data.alternative_enabled_p[alt])
+ continue;
+
/* Finally, update the costs with the information we've calculated
about this alternative. */
we may want to adjust the cost of that register class to -1.
Avoid the adjustment if the source does not die to avoid stressing of
- register allocator by preferrencing two colliding registers into single
+ register allocator by preferencing two colliding registers into single
class.
Also avoid the adjustment if a copy between registers of the class
We should only record information for REGs with numbers
greater than or equal to MIN_REGNO. */
-extern struct tree_opt_pass *current_pass;
-
static void
reg_scan_mark_refs (rtx x, rtx insn)
{
|| (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)))
src = XEXP (src, 0);
- if (REG_P (src))
- REG_ATTRS (dest) = REG_ATTRS (src);
- if (MEM_P (src))
- set_reg_attrs_from_mem (dest, src);
+ set_reg_attrs_from_value (dest, src);
}
/* ... fall through ... */
static hashval_t
som_hash (const void *x)
{
- const struct subregs_of_mode_node *a = x;
+ const struct subregs_of_mode_node *const a =
+ (const struct subregs_of_mode_node *) x;
return a->block;
}
static int
som_eq (const void *x, const void *y)
{
- const struct subregs_of_mode_node *a = x;
- const struct subregs_of_mode_node *b = y;
+ const struct subregs_of_mode_node *const a =
+ (const struct subregs_of_mode_node *) x;
+ const struct subregs_of_mode_node *const b =
+ (const struct subregs_of_mode_node *) y;
return a->block == b->block;
}
dummy.block = regno & -8;
slot = htab_find_slot_with_hash (subregs_of_mode, &dummy,
dummy.block, INSERT);
- node = *slot;
+ node = (struct subregs_of_mode_node *) *slot;
if (node == NULL)
{
node = XCNEW (struct subregs_of_mode_node);
gcc_assert (subregs_of_mode);
dummy.block = regno & -8;
- node = htab_find_with_hash (subregs_of_mode, &dummy, dummy.block);
+ node = (struct subregs_of_mode_node *)
+ htab_find_with_hash (subregs_of_mode, &dummy, dummy.block);
if (node == NULL)
return;
gcc_assert (subregs_of_mode);
dummy.block = regno & -8;
- node = htab_find_with_hash (subregs_of_mode, &dummy, dummy.block);
+ node = (struct subregs_of_mode_node *)
+ htab_find_with_hash (subregs_of_mode, &dummy, dummy.block);
if (node == NULL)
return false;
#endif
}
-struct tree_opt_pass pass_subregs_of_mode_init =
+struct rtl_opt_pass pass_subregs_of_mode_init =
{
+ {
+ RTL_PASS,
"subregs_of_mode_init", /* name */
gate_subregs_of_mode_init, /* gate */
init_subregs_of_mode, /* execute */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- 0 /* letter */
+ 0 /* todo_flags_finish */
+ }
};
-struct tree_opt_pass pass_subregs_of_mode_finish =
+struct rtl_opt_pass pass_subregs_of_mode_finish =
{
+ {
+ RTL_PASS,
"subregs_of_mode_finish", /* name */
gate_subregs_of_mode_init, /* gate */
finish_subregs_of_mode, /* execute */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- 0 /* letter */
+ 0 /* todo_flags_finish */
+ }
};