Commit d508a932 by Jakub Jelinek Committed by Jakub Jelinek

regrename.c (regrename_do_replace): If replacing the same reg multiple times,…

regrename.c (regrename_do_replace): If replacing the same reg multiple times, try to reuse last created gen_raw_REG.

	* regrename.c (regrename_do_replace): If replacing the same
	reg multiple times, try to reuse last created gen_raw_REG.

From-SVN: r256596
parent 708c4094
2018-01-12 Jakub Jelinek <jakub@redhat.com> 2018-01-12 Jakub Jelinek <jakub@redhat.com>
* regrename.c (regrename_do_replace): If replacing the same
reg multiple times, try to reuse last created gen_raw_REG.
PR debug/81155 PR debug/81155
* bb-reorder.c (pass_partition_blocks::gate): In lto don't partition * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
main to workaround a bug in GDB. main to workaround a bug in GDB.
...@@ -1394,7 +1397,7 @@ ...@@ -1394,7 +1397,7 @@
2018-01-04 Jakub Jelinek <jakub@redhat.com> 2018-01-04 Jakub Jelinek <jakub@redhat.com>
PR debug/83666 PR debug/83666
* cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode * cfgexpand.c (expand_debug_expr) <case BIT_FIELD_REF>: Punt if mode
is BLKmode and bitpos not zero or mode change is needed. is BLKmode and bitpos not zero or mode change is needed.
2018-01-04 Richard Sandiford <richard.sandiford@linaro.org> 2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
......
...@@ -963,6 +963,7 @@ regrename_do_replace (struct du_head *head, int reg) ...@@ -963,6 +963,7 @@ regrename_do_replace (struct du_head *head, int reg)
struct du_chain *chain; struct du_chain *chain;
unsigned int base_regno = head->regno; unsigned int base_regno = head->regno;
machine_mode mode; machine_mode mode;
rtx last_reg = NULL_RTX, last_repl = NULL_RTX;
for (chain = head->first; chain; chain = chain->next_use) for (chain = head->first; chain; chain = chain->next_use)
{ {
...@@ -975,12 +976,16 @@ regrename_do_replace (struct du_head *head, int reg) ...@@ -975,12 +976,16 @@ regrename_do_replace (struct du_head *head, int reg)
gen_rtx_UNKNOWN_VAR_LOC (), true); gen_rtx_UNKNOWN_VAR_LOC (), true);
else else
{ {
validate_change (chain->insn, chain->loc, if (*chain->loc != last_reg)
gen_raw_REG (GET_MODE (*chain->loc), reg), true); {
if (regno >= FIRST_PSEUDO_REGISTER) last_repl = gen_raw_REG (GET_MODE (*chain->loc), reg);
ORIGINAL_REGNO (*chain->loc) = regno; if (regno >= FIRST_PSEUDO_REGISTER)
REG_ATTRS (*chain->loc) = attr; ORIGINAL_REGNO (last_repl) = regno;
REG_POINTER (*chain->loc) = reg_ptr; REG_ATTRS (last_repl) = attr;
REG_POINTER (last_repl) = reg_ptr;
last_reg = *chain->loc;
}
validate_change (chain->insn, chain->loc, last_repl, true);
} }
} }
......
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