[Bug target/105257] [8/9/10/11/12 regression] ICE in final_scan_insn_1, at final.cc:2811

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 19 09:18:18 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105257

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52830&action=edit
gcc12-pr105257.patch

Untested fix.

The problem is that (reg:DI 24 %i0 [109]) in a delay slot of the return
satisfies sparc_pic_register_p but epilogue_renumber turns that into:
(reg:DI 8 %o0) which doesn't satisfy it.
The attached patch fixes that by always copying over ORIGINAL_REGNO.
A variant could be to do that only if ORIGINAL_REGNO is non-zero, if it is
zero,
keep using gen_reg_RTX (which can create a shared rtx and therefore shouldn't
have ORIGINAL_REGNO modified).


More information about the Gcc-bugs mailing list