On Tue, May 18, 2021 at 11:52:27AM -0600, Jeff Law via Gcc-patches wrote: > On 5/18/2021 2:56 AM, Joern Rennecke wrote: > >I find that when compiling some files, lra goes into an infinite loop > >reloading constant > >addresses. This patch allows them to just be recognized as matching > >addresses > >immediately, which also saves a bit of space for a few other files. > > > >Bootstrapped and regression tested on x86_64-pc-linux-gnu. > > > >process_addr_reg-elim.txt > > > >gcc/ > > * lra-constraints.c: New arguments mem_mode and as. Changed caller. > > If equivalence search has yielded a constant that is valid as an > > address, use it. > > At first glance it seems to me like you're papering over a target bug.
Yeah. It means that curr_insn_transform did not return early, which it should if the insn is a single_set (likely, but Joern didn't show the actual insns, so we don't know), or simple_move_p isn't true. And the latter means that register_move_cost isn't 2, which all trivial moves should have. Does that help? Segher