Commit 9f1c93df by Alexander Monakov Committed by Alexander Monakov

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
parent 2ffc0382
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> 2017-08-29 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.opt (flag_fentry): Do not init to -1. * config/i386/i386.opt (flag_fentry): Do not init to -1.
......
...@@ -1138,17 +1138,12 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x, ...@@ -1138,17 +1138,12 @@ record_address_regs (machine_mode mode, addr_space_t as, rtx x,
if (code1 == SUBREG) if (code1 == SUBREG)
arg1 = SUBREG_REG (arg1), code1 = GET_CODE (arg1); arg1 = SUBREG_REG (arg1), code1 = GET_CODE (arg1);
/* If this machine only allows one register per address, it /* If index registers do not appear, or coincide with base registers,
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,
just record registers in any non-constant operands. We just record registers in any non-constant operands. We
assume here, as well as in the tests below, that all assume here, as well as in the tests below, that all
addresses are in canonical form. */ addresses are in canonical form. */
else if (INDEX_REG_CLASS if (MAX_REGS_PER_ADDRESS == 1
== base_reg_class (VOIDmode, as, PLUS, SCRATCH)) || INDEX_REG_CLASS == base_reg_class (VOIDmode, as, PLUS, SCRATCH))
{ {
record_address_regs (mode, as, arg0, context, PLUS, code1, scale); record_address_regs (mode, as, arg0, context, PLUS, code1, scale);
if (! CONSTANT_P (arg1)) if (! CONSTANT_P (arg1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment