Ping. I'd like to try to merge the pending SH LRA changes before the GCC 16 release. The debian guys have been using a patchedGCC version with SH LRA enabled for a while now and it seems feasible, at least from this point of view.
I'd appreciate some feedback on this. Thanks! Oleg Endo On Mon, 2026-02-23 at 14:26 +0900, Oleg Endo wrote: > Hi, > > In order to move the SH backend over to LRA there is one more missing piece. > > On SHÂ we have two fp constant load insns "fldi0" and "fldi1". However, they > are bound to single-precision fp mode. We were hitting some cases where LRA > wants to substitute constant loads, which have been emitted differently > originally, and picks up those "fldi0" / "fldi1" insns but doesn't check > whether they are valid for the current fp mode. > > Eventually LRA should be taught to check that any substitution is valid for > any mode, not just fp mode. But for now, the quick solution is to add a > cannot_substitute_const_equiv_p target hook. > > Bootsrapped on x86_64. OK to apply? > > gcc/ChangeLog: > PR target/117182 > * target.def (cannot_substitute_const_equiv_p): New target hook. > * doc/tm.texi.in: Add it. > * lra-constraints.cc (get_equiv): Use it. > * config/sh/sh.cc (sh_cannot_substitute_const_equiv_p): Override > it. > * doc/tm.texi: Re-generate.
