https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108573
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- --- gcc/ree.cc.jj 2023-01-02 09:32:45.327953792 +0100 +++ gcc/ree.cc 2023-01-31 18:36:31.253018233 +0100 @@ -875,7 +875,8 @@ combine_reaching_defs (ext_cand *cand, c for (df_link *use = uses; use; use = use->next) if (paradoxical_subreg_p (GET_MODE (*DF_REF_LOC (use->ref)), - GET_MODE (SET_DEST (*dest_sub_rtx)))) + GET_MODE (SET_DEST (*dest_sub_rtx))) + && !DEBUG_INSN_P (DF_REF_INSN (use->ref))) return false; } fixes this particular -fcompare-debug failure. Dunno though about get_uses, it performs some checks and returns NULL if those fail (again, ignoring if the failures are from DEBUG_INSNs or something else), plus in theory there could be a non-NULL ref_chain of only debug uses (though hopefully we prevent that). And there is another spot that would need the same change as above.