Message ID | 20130330171125.76877421213@build1-lucid-cs |
---|---|
State | New |
Headers | show |
On 30-03-13 18:11, Tom de Vries wrote: > Richard, > > This patch series adds analysis of register usage of functions for usage by IRA. > The original post is here > ( http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01234.html ). > > This patch implements the target hook TARGET_FN_OTHER_HARD_REG_USAGE for ARM. > The target hook TARGET_FN_OTHER_HARD_REG_USAGE was introduced in the previous > patch in this patch series. > > Build and reg-tested on ARM. > > OK for trunk? > Richard, Ping. OK for stage1? Thanks, - Tom > Thanks, > -Tom > > 2013-03-30 Radovan Obradovic <robradovic@mips.com> > Tom de Vries <tom@codesourcery.com> > > * config/arm/arm.c (TARGET_FN_OTHER_HARD_REG_USAGE): Redefine as > arm_fn_other_hard_reg_usage. > (arm_fn_other_hard_reg_usage): New function. >
On 06/12/13 00:54, Tom de Vries wrote: > On 30-03-13 18:11, Tom de Vries wrote: >> Richard, >> >> This patch series adds analysis of register usage of functions for usage by IRA. >> The original post is here >> ( http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01234.html ). >> >> This patch implements the target hook TARGET_FN_OTHER_HARD_REG_USAGE for ARM. >> The target hook TARGET_FN_OTHER_HARD_REG_USAGE was introduced in the previous >> patch in this patch series. >> >> Build and reg-tested on ARM. >> >> OK for trunk? >> > > Richard, > > Ping. OK for stage1? > > Thanks, > - Tom > >> Thanks, >> -Tom >> >> 2013-03-30 Radovan Obradovic <robradovic@mips.com> >> Tom de Vries <tom@codesourcery.com> >> >> * config/arm/arm.c (TARGET_FN_OTHER_HARD_REG_USAGE): Redefine as >> arm_fn_other_hard_reg_usage. >> (arm_fn_other_hard_reg_usage): New function. >> > > OK. R.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5f63a2e..341fa86 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -280,6 +280,7 @@ static unsigned arm_add_stmt_cost (void *data, int count, static void arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, bool op0_preserve_value); +static void arm_fn_other_hard_reg_usage (struct hard_reg_set_container *); /* Table of machine attributes. */ static const struct attribute_spec arm_attribute_table[] = @@ -649,6 +650,10 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_CANONICALIZE_COMPARISON \ arm_canonicalize_comparison +#undef TARGET_FN_OTHER_HARD_REG_USAGE +#define TARGET_FN_OTHER_HARD_REG_USAGE \ + arm_fn_other_hard_reg_usage + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -3762,6 +3767,19 @@ arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, } } +/* Implement TARGET_FN_OTHER_HARD_REG_USAGE. */ + +static void +arm_fn_other_hard_reg_usage (struct hard_reg_set_container *regs) +{ + if (TARGET_AAPCS_BASED) + { + /* For AAPCS, IP and CC can be clobbered by veneers inserted by the + linker. */ + SET_HARD_REG_BIT (regs->set, IP_REGNUM); + SET_HARD_REG_BIT (regs->set, CC_REGNUM); + } +} /* Define how to find the value returned by a function. */