https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69447
--- Comment #14 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Richard Henderson from comment #13) > (In reply to Jakub Jelinek from comment #11) > > Without knowing the lra-remat code at all, I just wonder if subreg_regs > > needs to be one per the whole function, rather than say per extended basic > > block or basic block, with the patch any uses in multi-reg subregs anywhere > > in the function will affect remat of all other spots where it is used. > > I started with subreg_regs being per-block. But since IRA has > some global component, I was concerned that there would be some > edge case that would be missed, and switched to a global bitmap. > > Perhaps someone who knows the allocator better can comment. Richard, thanks for working on it. You used the right approach. I believe some edge cases are possible, e.g. sched1 could move one subreg insn into another block. So just non-global approach would be vulnerable. The patch looks ok to me. So you can commit it if the test results are ok. Thanks again. I had no time to work on it as I am too busy with other RA bugs.