https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69671
--- Comment #13 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #9) > But something like that might remove the flexibility from the register > allocator. > > Wonder why the RA in this case doesn't see that the value loaded into that > pseudo register is CONST0_RTX which satisfies the C constraint and doesn't > undo CSE (rematerialize) in that case if it doesn't have that value already > loaded in the matching register to the output one. LRA remat is a simple global scope subpass to remove reload loads from memory by reusing values held in registers. It does not check constraints at all. Adding some checks will complicate the sub-pass much. I think Kirill proposed a good solution: "Split all patterns into match_dup and 0_operand by hand" I believe it will work well for RA.