From: Alexander Monakov Date: Tue, 29 Aug 2017 17:34:21 +0000 (+0300) Subject: ira-costs: avoid missing base registers in record_address_regs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f1c93df4811bcef7e852f20c902e6e72c34dec9;p=gcc.git ira-costs: avoid missing base registers in record_address_regs * ira-costs.c (record_address_regs): Handle both operands of PLUS for MAX_REGS_PER_ADDRESS == 1. From-SVN: r251418 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3cf1c74b758..35bd37964fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-08-29 Alexander Monakov + + * ira-costs.c (record_address_regs): Handle both operands of PLUS for + MAX_REGS_PER_ADDRESS == 1. + 2017-08-29 Uros Bizjak * config/i386/i386.opt (flag_fentry): Do not init to -1. diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 2cd102a0810..1690e889471 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1138,17 +1138,12 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x, if (code1 == SUBREG) arg1 = SUBREG_REG (arg1), code1 = GET_CODE (arg1); - /* If this machine only allows one register per address, it - must be in the first operand. */ - if (MAX_REGS_PER_ADDRESS == 1) - record_address_regs (mode, as, arg0, 0, PLUS, code1, scale); - - /* If index and base registers are the same on this machine, + /* If index registers do not appear, or coincide with base registers, just record registers in any non-constant operands. We assume here, as well as in the tests below, that all addresses are in canonical form. */ - else if (INDEX_REG_CLASS - == base_reg_class (VOIDmode, as, PLUS, SCRATCH)) + if (MAX_REGS_PER_ADDRESS == 1 + || INDEX_REG_CLASS == base_reg_class (VOIDmode, as, PLUS, SCRATCH)) { record_address_regs (mode, as, arg0, context, PLUS, code1, scale); if (! CONSTANT_P (arg1))