[PR81611] turn inc-and-use-of-dead-orig into auto-inc
When the addressing modes available on the machine don't allow offsets
in addresses, odds are that post-increments will be represented in
trees and RTL as:
y <= x + 1
... *(x) ...
x <= y
so deal with it by turning such RTL as:
(set y (plus x n))
... (mem x) ...
without intervening uses of y into
(set y x)
... (mem (post_add y n)) ...
so as to create auto-inc addresses that we'd otherwise miss.
for gcc/ChangeLog
PR rtl-optimization/81611
* auto-inc-dec.c (attempt_change): Move dead note from
mem_insn if it's the next use of regno
(find_address): Take address use of reg holding
non-incremented value. Add parm to limit search to the named
reg only.
(merge_in_block): Attempt to use a mem insn that is the next
use of the original regno.
From-SVN: r258053