https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611
--- Comment #24 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- Author: aoliva Date: Wed Feb 28 05:25:34 2018 New Revision: 258053 URL: https://gcc.gnu.org/viewcvs?rev=258053&root=gcc&view=rev Log: [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. Modified: trunk/gcc/ChangeLog trunk/gcc/auto-inc-dec.c