https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118615
--- Comment #30 from Surya Kumari Jangala <jskumari at gcc dot gnu.org> --- Going thru the 2 patches (r15-2810 and r15-8656), I realized that before_p should be honoured. The significance of before_p : For jmp/call insns which have a hard reg as a src register, the split/inheritance pass generates the ‘save’ before the jmp/call. This pass also generates the ‘restore’ before a subsequent insn that reads the hard reg. If the ‘save’ is generated after the call insn, then the register being saved may have been over-written by the call. So ‘save’ has to happen before the call insn. Similarly, for jmp insn, if the ’save’ is generated after the jmp, then any ‘restore’ generated at the target of the jmp would not get the ‘correct’ register value. Hence, for jmp/call insns, the ‘save’ is always generated before. However, the patch r15-2810 is not honouring before_p. And this is an issue which has to be fixed. If before_p is honoured, then the correct 'use_insn' is passed to add_next_usage_insn. I have a patch that honors before_p and I am running regression tests for the same. Will send it for review once I am done.