https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106746
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Alex, please correct me if I'm wrong, but I think the scheduling DEBUG_INSN decision was that DEBUG_INSNs are somehow taken into account during scheduling, not completely ignored, so that they actually move together with scheduling changes. I know H.J. has posted a patch to ignore for scheduling purposes everything inside of CONCAT{,N}, but the scheduler itself doesn't specifically check for those 2 rtxes anywhere, so I don't find anything special on them. And as has been tried, ignoring DEBUG_INSNs for all scheduler decisions regresses a lot (not unsuprisingly), they should be scheduled after insns which produce/store what they depend on and before later insns that modify the registers/memroy used in them if possible (or reset if that would affect how non-DEBUG_INSNs are scheduled relative to each other). Though, I think DEBUG_INSNs should be treated as needing no computing resources, with 0 latencies.