https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117182
--- Comment #5 from Kazumoto Kojima <kkojima at gcc dot gnu.org> --- Created attachment 59367 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59367&action=edit a trial patch Add cannot_substitute_const_equiv_p target hook so to avoid unsafe substitution for machines with special constant load instructions usable in the limited mode, such as fldi0/1 instructions on SH. gcc/ChangeLog: * target.def (cannot_substitute_const_equiv_p): New target hook. * doc/tm.texi.in: Update. * doc/tm.texi: Re-generate. * lra-constraints.cc (get_equiv): Use it. * config/sh/sh.cc (sh_cannot_substitute_const_equiv_p): New function. Tested with c/c++ testsuite on devel/sh-lra only.