diff options
author | Alexander Monakov <amonakov@ispras.ru> | 2017-08-29 20:34:21 +0300 |
---|---|---|
committer | Alexander Monakov <amonakov@gcc.gnu.org> | 2017-08-29 20:34:21 +0300 |
commit | 9f1c93df4811bcef7e852f20c902e6e72c34dec9 (patch) | |
tree | 4aa22898903a7ae206032cb78ce114dcc40c6814 | |
parent | 2ffc0382ff79b23a6f88113d277842934de258ed (diff) | |
download | gcc-9f1c93df4811bcef7e852f20c902e6e72c34dec9.zip gcc-9f1c93df4811bcef7e852f20c902e6e72c34dec9.tar.gz gcc-9f1c93df4811bcef7e852f20c902e6e72c34dec9.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ira-costs.c | 11 |
2 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3cf1c74..35bd379 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-08-29 Alexander Monakov <amonakov@ispras.ru> + + * ira-costs.c (record_address_regs): Handle both operands of PLUS for + MAX_REGS_PER_ADDRESS == 1. + 2017-08-29 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.opt (flag_fentry): Do not init to -1. diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 2cd102a..1690e88 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)) |