https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635
--- Comment #20 from Jim Wilson <wilson at gcc dot gnu.org> --- Created attachment 46830 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46830&action=edit proposed patch to fix paradoxical reg in splitter problem I get better code size with this alternative patch. I added two more testcases for the issues I found while evaluating this patch. There is no change to the rv32/newlib libc/libstdc++ library code sizes. The rv64/linux libc.so is now 94 bytes smaller. The libstdc++.so is 6 bytes larger but text is 10 bytes smaller and rodata is 16 bytes larger. I'm not sure what happened there, maybe alignment padding, but I can live with it. The text section looks like the same code, but slightly better register allocation, which allows a few more compressed instructions to be used. This has passed rv32/newlib and rv64/linux cross toolchain build and check. The new testcase from Jakub still works, along with my two new testcases. I tried adding instrumentation to the patch to abort if I ended up with a paradoxical reg in the splitters, and it never triggered, so it looks like combine is doing the right thing when allocating a reg for the clobber.