Hi Ramana, > My only question would be whether it's more suitable to use > optimize_function_for_size_p(cfun) instead as IIRC that gives us a > chance with lto rather than the global optimize_size.
Yes that is even better and that defaults to optimize_size if cfun isn't set. I've committed this: diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8b67c9c3657b312be223ab60c01969958baa9ed3..5fad1e5bcc2bc448489fdc8239c676246bbc8879 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1068,9 +1068,8 @@ extern int arm_regs_in_sequence[]; /* Use different register alloc ordering for Thumb. */ #define ADJUST_REG_ALLOC_ORDER arm_order_regs_for_local_alloc () -/* Tell IRA to use the order we define rather than messing it up with its - own cost calculations. */ -#define HONOR_REG_ALLOC_ORDER 1 +/* Tell IRA to use the order we define when optimizing for size. */ +#define HONOR_REG_ALLOC_ORDER optimize_function_for_size_p (cfun) /* Interrupt functions can only use registers that have already been saved by the prologue, even if they would normally be