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. */