and are also considered fixed. */
char global_regs[FIRST_PSEUDO_REGISTER];
+/* Declaration for the global register. */
+static tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
+
/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
in dataflow more conveniently. */
regset regs_invalidated_by_call_regset;
}
/* Compute cost of moving registers to/from memory. */
+
int
-memory_move_cost (enum machine_mode mode, enum reg_class rclass, bool in)
+memory_move_cost (enum machine_mode mode, reg_class_t rclass, bool in)
{
return targetm.memory_move_cost (mode, rclass, in);
}
/* Mark register number I as global. */
void
-globalize_reg (int i)
+globalize_reg (tree decl, int i)
{
+ location_t loc = DECL_SOURCE_LOCATION (decl);
+
#ifdef STACK_REGS
if (IN_RANGE (i, FIRST_STACK_REG, LAST_STACK_REG))
{
#endif
if (fixed_regs[i] == 0 && no_global_reg_vars)
- error ("global register variable follows a function definition");
+ error_at (loc, "global register variable follows a function definition");
if (global_regs[i])
{
- warning (0, "register used for two global register variables");
+ warning_at (loc, 0,
+ "register of %qD used for multiple global register variables",
+ decl);
+ inform (DECL_SOURCE_LOCATION (global_regs_decl[i]),
+ "conflicts with %qD", global_regs_decl[i]);
return;
}
if (call_used_regs[i] && ! fixed_regs[i])
- warning (0, "call-clobbered register used for global register variable");
+ warning_at (loc, 0, "call-clobbered register used for global register variable");
global_regs[i] = 1;
+ global_regs_decl[i] = decl;
/* If we're globalizing the frame pointer, we need to set the
appropriate regs_invalidated_by_call bit, even if it's already
union of most major pair of classes, that generality is not required. */
char altclass;
- /* coverclass is a register class that IRA uses for allocating
+ /* allocnoclass is a register class that IRA uses for allocating
the pseudo. */
- char coverclass;
+ char allocnoclass;
};
/* Record preferences of each pseudo. This is available after RA is
/* Return the reg_class which is used by IRA for its allocation. */
enum reg_class
-reg_cover_class (int regno)
+reg_allocno_class (int regno)
{
if (reg_pref == 0)
return NO_REGS;
- return (enum reg_class) reg_pref[regno].coverclass;
+ return (enum reg_class) reg_pref[regno].allocnoclass;
}
\f
\f
/* Set up preferred, alternate, and cover classes for REGNO as
- PREFCLASS, ALTCLASS, and COVERCLASS. */
+ PREFCLASS, ALTCLASS, and ALLOCNOCLASS. */
void
setup_reg_classes (int regno,
enum reg_class prefclass, enum reg_class altclass,
- enum reg_class coverclass)
+ enum reg_class allocnoclass)
{
if (reg_pref == NULL)
return;
gcc_assert (reg_info_size == max_reg_num ());
reg_pref[regno].prefclass = prefclass;
reg_pref[regno].altclass = altclass;
- reg_pref[regno].coverclass = coverclass;
+ reg_pref[regno].allocnoclass = allocnoclass;
}
\f